I’m new to coding and am currently trying to learn C++ myself. I just learned about function parameters and pass by value vs pass by reference. Everywhere I read, they say that one of the reasons pass by reference is useful is because it allows you to change the value of an argument inside the function. But why does making the parameter variable a reference let you do that? And why can’t you do that if you pass a value instead?
New contributor
Karanveer A is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.