Free help with homework

Why join Brainly?

  • ask questions about your assignment
  • get answers with explanations
  • find similar questions



This Is a Certified Answer

Certified answers contain reliable, trustworthy information vouched for by a hand-picked team of experts. Brainly has millions of high quality answers, all of them carefully moderated by our most trusted community members, but certified answers are the finest of the finest.
In procedural languages, C , C++ etc. we have some mechanisms for passing (formal) parameters to a function.

  When a function takes in a parameter and computes result and passes back as the return value, we need to use the mechanism of call by value. In this mechanism, any modification of the value of parameter inside the called function is not reflected to the calling function. ANy modifications to be done by called function can be in global data or the return value.

  When a function takes in a parameter as call by reference, the change in the parameter value itself is not reflected in the calling function.  Actually, the memory address of the variable of interest is passed to the called function. So using that address, the called function can modify the data in that memory address. This modification is useful to the calling function.

1 5 1
In call by reference you will get the instance of a variable. After changing parameters of function, in this case your variable will change in call method. In call by value you will get the copy of the instance. And in this case changes of parameter variable will not influence on variable that was in call method
0 0 0
The Brain
  • The Brain
  • Helper
Not sure about the answer?
Learn more with Brainly!
Having trouble with your homework?
Get free help!
  • 80% of questions are answered in under 10 minutes
  • Answers come with explanations, so that you can learn
  • Answer quality is ensured by our experts