0
What is the difference between passing variables to C++ function using
1) pass by reference with a pointer 2) pass by reference using a reference
2 Answers
0
You can only pass a c++ object via pointer if I remember it correctly. If you pass a pointer, you directly work with an adress which should have the effect that the changes persist outside the function as well.
0
It's mostly the same, except for abstractionâ. For the reference, inside the function you use normal variable Syntax instead of pointer Syntax. Also you can't change the address of a reference, so I would only use for an object, not an array.