fork(1) download
  1. #include <iostream>
  2. #include <memory>
  3. using namespace std;
  4.  
  5. int main() {
  6. shared_ptr<int> a { new int(5) };
  7. cout<< *a << endl;
  8. shared_ptr<int> b { a };
  9. *b = 10;
  10. cout << *a << endl;
  11. return 0;
  12. }
Success #stdin #stdout 0s 3412KB
stdin
Standard input is empty
stdout
5
10