Q:

What is the difference between pass by value by reference in c and pass by reference in c?

0

What is the difference between pass by value by reference in c and pass by reference in c?

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Answer:

Pass By Value:

  • In this method, the value of the variable is passed. Changes made to formal will not affect the actual parameters.
  • Different memory locations will be created for both variables.
  • Here there will be a temporary variable created in the function stack which does not affect the original variable.

Pass By Reference :

  • In Pass by reference, an address of the variable is passed to a function.
  • Whatever changes made to the formal parameter will affect the value of actual parameters(a variable whose address is passed).
  • Both formal and actual parameters shared the same memory location.
  • it is useful when you required to returns more than 1 value.

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Embedded C interview questions and answers (2022)

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
What is a reentrant function?... >>
<< Can static variables be declared in a header file?...