C++ References Question:
Download Questions PDF

Can you please explain the difference between pass by value and pass by reference?

Answer:

In pass by value approach, the called function creates another copies of the variables passes as arguments. In this approach, the values of the original variables remain unchanged. However, we come across situations where we need to change the values of the original variables. Then the values may b passed by reference.

Download C++ References Interview Questions And Answers PDF

Previous QuestionNext Question
What are References in C++?Identify the incorrect statement:
a) reference is the alternate name of the object
b) A reference value once defined can be reassigned
c) A reference value once defined cannot be reassigned
d) none of the mentioned