fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5.  
  6. int x = 10;
  7. int* ptr = &x;
  8. cout << &x << endl;
  9. cout << ptr << endl;
  10. int y = (*ptr)++;
  11.  
  12. cout << x << " " << y << endl;
  13. cout << ptr <<endl;
  14.  
  15. int z = ++*ptr;
  16. cout << z << endl;
  17. cout << x << endl;
  18.  
  19. return 0;
  20. }
Success #stdin #stdout 0.01s 5472KB
stdin
Standard input is empty
stdout
0x7ffd4b755c54
0x7ffd4b755c54
11 10
0x7ffd4b755c54
12
12