Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void passByValue(int x);
- void passByReference(int *x);
- int main (){
- int rodrigo = 13;
- int marco = 13;
- passByValue(rodrigo);
- passByReference(&marco);
- cout << "rodrigo is now " << rodrigo << endl;
- cout << "marco is now " << marco << endl;
- }
- void passByValue(int x){
- x = 99;
- }
- void passByReference(int *x){
- *x=66;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement