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