Parameter passing by reference
A parameter passing mechanism where the address of the argument is passed to the function. Changes to the parameter inside the function affect the original variable. By reference passing enables functions to modify external state and avoids copying overhead. This mechanism is efficient but requires careful use to prevent unintended side effects.
Real World
When Instagram applies a filter to your photo, the image array is passed by reference so the function modifies the original pixel data directly, avoiding the overhead of copying millions of pixels.
Exam Focus
Contrast with by-value in your answer — state that the original variable IS changed, and explain the shared memory address.
How well did you know this?