fork download
  1. #include<iostream>
  2. using namespace std;
  3. int main()
  4. {
  5. int *p1, *p2;
  6. int a = 5;
  7. int b;
  8. p1 = &a;
  9. p1 = p2;
  10.  
  11. b = 10;
  12.  
  13.  
  14.  
  15. cout<<"\nValue for P1 is "<< *p1;
  16. cout<<"\nValue for P2 is "<< *p2;
  17.  
  18. //p1 = new int;
  19. //p1 = &b;
  20.  
  21. cout<<"\nValue for P1 is "<< p1;
  22. cout<<"\nValue for P2 is "<< p2 <<"\n";
  23.  
  24.  
  25. }
  26.  
Runtime error #stdin #stdout 0s 3292KB
stdin
Standard input is empty
stdout
Standard output is empty