Sunday, July 12, 2009

What is the difference between Call by reference and call by pointer in C++ function?

It's actually pass by reference and pass by value.





Pass by reference passes the address of the variable. This means that if you change the value of the variable within the function, it will be changed for the calling function as well.





Pass by value makes a copy of the value. You can change it and it will no be changed for the calling function.


No comments:

Post a Comment