parameters value reference Flashcards

1
Q

what is passing a parameter by value

A

A local copy of the data is used
Data is discarded when the
subprogram exits
Does not override/change the original
data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

what is passing a parameter by reference

A

address of the parameter is given to the subroutine, so the
value of the parameter will be updated at the given address. Changes remain after the subprogram
exits

How well did you know this?
1
Not at all
2
3
4
5
Perfectly