Parameter passing by value
A parameter passing mechanism where a copy of the argument value is passed to the function. Changes to the parameter inside the function do not affect the original variable. By value passing isolates function logic from external state changes. This mechanism is safe but inefficient for large data structures.
Real World
When Google Maps calculates a route, it passes your coordinates by value to a distance function — the original location data stays unchanged even as the function processes copies internally.
Exam Focus
Draw a memory diagram showing the original variable unchanged after the function call — this visual evidence earns full marks.
How well did you know this?