Which parameter-passing method does not allow the function to modify the actual argument?
- By value
- By reference
- By pointer
- By name
When parameters are passed by value, a copy of the argument is made for the function. Any modifications to this copy do not affect the original argument outside the function.
Loading...
Related Quiz
- In what year was the C++17 standard released?
- The _______ keyword is used when we want to explicitly pass by reference but prevent the function from modifying the argument.
- In C++, _______ functions cannot be virtual.
- If a break statement is encountered in a nested loop, it will exit _______.
- What is the primary reason for using smart pointers over raw pointers in modern C++?