Guest User

Untitled

a guest
Feb 4th, 2015
387
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.30 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int* f(int& i){i+=4; return &i;}
  6. int g(int i){return i*=2;}
  7. void h(int*i){*i-=3;}
  8. int  main(){
  9. int A;
  10. A=g(3);
  11. cout<<A; // A= 6
  12. A--;
  13. cout<<A;// A= 5
  14. h(&A);
  15. cout<<A;// A= 2
  16. (*f(A))--;
  17. cout<<A;// A= 5 dlaczego?
  18. g(A);
  19. cout<<A;}// A=5 ale dlaczego?
Advertisement
Add Comment
Please, Sign In to add comment