fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. int v =8, *r, *s;
  7. int *p;
  8. int q = 100;
  9.  
  10. p= &q;
  11. r =p;
  12. *p = 20;
  13.  
  14. p= new int;
  15. *r = 30;
  16. q=v;
  17. s=p;
  18. *s=50;
  19.  
  20. cout << *p << endl;
  21. cout << q << endl;
  22. cout << *r << endl;
  23. cout << v << endl;
  24. cout << *s << endl;
  25. }
Success #stdin #stdout 0.01s 5276KB
stdin
Standard input is empty
stdout
50
8
8
8
50