fork download
  1. #include <iostream>
  2. using namespace std;
  3. void pointer(int x, int y){
  4.  
  5. int *p;
  6. p = &x;
  7. ++(*p);
  8. p = &y;
  9. cout<<x<<" "<<y<<" "<<*p<<endl;
  10.  
  11. }
  12. int main() {
  13. // your code goes here
  14. int x = 5;
  15. int y = 6;
  16. pointer(x, y);
  17. return 0;
  18. }
Success #stdin #stdout 0s 5504KB
stdin
Standard input is empty
stdout
6  6  6