fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int* a = new int();
  6. *a = 1;
  7. cout << *a << endl;
  8.  
  9. delete a;
  10. cout << *a << endl;
  11.  
  12. int* b = new int();
  13. *b = 2;
  14. cout << *a << endl;
  15. cout << *b << endl;
  16.  
  17. delete a;
  18. cout << *a << endl;
  19. cout << *b << endl;
  20. return 0;
  21. }
Success #stdin #stdout 0s 3472KB
stdin
Standard input is empty
stdout
1
0
2
2
0
0