Home / Questions / What are the different ways of passing parameters to the functions? Which to use when?
Explanatory Question

What are the different ways of passing parameters to the functions? Which to use when?

👁 1,344 Views
📘 Detailed Answer
🕒 Easy to Read
Read the answer carefully and go through the related questions on the right side to improve your understanding of this topic.

Answer with Explanation

  • Call by value − We send only values to the function as parameters. We choose this if we do not want the actual parameters to be modified with formal parameters but just used.

  • Call by reference − We send address of the actual parameters instead of values. We choose this if we do want the actual parameters to be modified with formal parameters.