fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int * p1 = 0;
  6. int p2 = *p1;
  7. cout << "&p2 != 0: " << (&p2 != 0) << endl;
  8. cout << "*p1 = 1 : " << flush;
  9. *p1 = 1;
  10. cout << "ok" << endl;
  11. return 0;
  12. }
Runtime error #stdin #stdout 0s 3096KB
stdin
Standard input is empty
stdout
&p2 != 0: 1
*p1 = 1 :