When an array is passed to a function, it is always passed by _______.
- value
- reference
- name
- address
When an array is passed to a function, it is passed by name, which essentially means the address of the array is passed. This allows functions to modify the original array. The behavior is similar to passing by reference.
Loading...
Related Quiz
- A C++ application is experiencing crashes due to memory corruption. During debugging, you notice that a function modifies the memory location of a pointer passed to it, affecting other parts of the application. Which concept might help prevent this issue in future implementations?
- What does the term “Diamond Problem” refer to in the context of C++ inheritance?
- What is slicing in the context of object-oriented programming in C++?
- How does the C++ compiler handle different types of exceptions in a function template?
- If a break statement is encountered in a nested loop, it will exit _______.