#include <iostream>
#include <memory>
std::shared_ptr<int> getData() {
std::shared_ptr<int> a = std::make_shared<int>(5);
return a;
}
int main() {
auto b = getData();
auto c = b;
std::cout << *b << std::endl;
std::cout << *c << std::endl;
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: