Question discussion

Which of the following techniques can be used to modify the actual variable passed to a function?

359243Medium DSSSB TGT Computer Science 0 replies 0 views
0
Which of the following techniques can be used to modify the actual variable passed to a function?
  • AUse a local variable instead of passing any parameters.
  • BPass a copy of the actual parameter to function.
  • CStandard C has no options for modifying actual variables passed to a function.
  • DPass the address of the actual parameters to function.
Correct answer: D

Explanation

To change the caller's actual variable, pass its address (pointer) to the function.

Discussion 0

Nobody has replied yet. Start the discussion!