Multiple choice

Which of the following symbols is used to denote passing of arguments 'by reference'?

  1. *

  2. &

  3. %

  4. !

  5. #

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The call by reference method of passing arguments to a function copies the reference of an argument into the formal parameter. Inside the function, the reference is used to access the actual argument used in the call. This means that changes made to the parameter affect the passed argument. The ampersand(&) sign is used to denote pass by reference.