For C++, why is it that reference values can change when given to a function? I understand that if you make a const reference parameter like: double functionname(const point& p1) then the function cannot attempt to make a change to the parameter.
Added by Shelby S.
Step 1
When we pass a variable by value to a function, a copy of that variable is created and passed to the function. Any changes made to the copy inside the function do not affect the original variable. Show more…
Show all steps
Your feedback will help us improve your experience
Christian Otero and 71 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
What is Function Overloading? How we can implement more than one function in the program with the same function name? Use C++ program
Sarvesh S.
Why do two different antiderivatives of a function differ by a constant?
Madhur L.
Applications of the Derivative
Antiderivatives
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Watch the video solution with this free unlock.
EMAIL
PASSWORD