Advertisement
Guest User

Untitled

a guest
Nov 24th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. void passByValue(int x);
  2. void passByReference(int *x);
  3.  
  4. int main (){
  5. int rodrigo = 13;
  6. int marco = 13;
  7.  
  8.  
  9. passByValue(rodrigo);
  10. passByReference(&marco);
  11.  
  12. cout << "rodrigo is now " << rodrigo << endl;
  13. cout << "marco is now " << marco << endl;
  14.  
  15. }
  16.  
  17. void passByValue(int x){
  18. x = 99;
  19. }
  20.  
  21. void passByReference(int *x){
  22. *x=66;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement