04 Try it yourself Interactive

Same seven steps, opposite outcome

Two tiny programs with the same shape. One passes a number into a function that changes its parameter; the other passes an array into a function that changes an element. Watch main's frame while the callee writes, and watch what is left after the callee pops. Nothing moves until you press Next.

Pass a number
the value is copied
One whole number from 0 to 9.
Press Next to begin. Each press moves one step.


      
Caller sees
Callee sees
Frames0
Caller changed0
step 0 / 0