ubuntuguy
asked on
C++ Call by reference VS Call by value
I don't really think that I understand the difference between calling by value and calling by reference.
When I call by value, the function doesn't modify variables in the class, but it only creates local variables inside the function? And when I call by reference, the function actually modifies the variables?
I'm confused. I've looked online, but I just don't get it. Can anybody give me as simple Barney style explanation?
When I call by value, the function doesn't modify variables in the class, but it only creates local variables inside the function? And when I call by reference, the function actually modifies the variables?
I'm confused. I've looked online, but I just don't get it. Can anybody give me as simple Barney style explanation?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Yes, that pretty much sums it up. Now, if you thing the above sample to pass objects instead of integers, you have the big picture.
ASKER
thanks
ASKER