HP Inc. Interview Question

What's the difference between passing by reference and passing by value in C++?

Interview Answer

Anonymous

Apr 5, 2023

Passing by reference gives the callee function the address of the variable to directly change while passing by value sends a copy to the callee function and does not change the variable when returning to the caller function