What do you mean by call by value and call by reference?
Answer Posted / hr@tgksolutions.com
A common topic that often appears in C++ interview questions is the difference between call by value and call by reference.
• Call by Value in C++: In the call-by-value method, function arguments are passed by copying the value of the actual parameter.
• This ensures that the original values remain unchanged since a separate copy of the value is created for the function's parameters.
• Call by Reference in C++: In the call-by-reference method, the memory address (or reference) of the actual parameter is passed to the function.
• This allows direct access to and modification of the original values.
• Both the actual and formal parameters refer to the same memory address, so any changes made to the parameters within the function are directly reflected in the original values outside the function.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Describe the setting up of my member functions to avoid overriding by the derived class?
What do you mean by overhead in c++?
Define the process of error-handling in case of constructor failure?
Are iterators pointers?
Is the declaration of a class its interface or its implementation?
What is object in c++ wikipedia?
When are exception objects created?
Explain the use of this pointer?
Write a Program for dynamically intialize a 2 dimentional array. Eg:5x20, accept strings and check for vowels and display the no.finally free the space allocated .
What will happen if a pointer is deleted twice?
What is a base class?
Difference between an inspector and a mutator
What is null pointer and void pointer?
Difference between declaration and definition of a variable.
When you overload member functions, in what ways must they differ?