What do you mean by call by value and call by reference?
Answer Posted / glibwaresoftsolutions
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
What is a friend function in c++?
Explain what you mean by a pointer.
Write a program to find the Fibonacci series recursively.
Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the maximum number of concurrent threads that the InnoDB plug-in can create
Define token in c++.
What is a wchar_t in c++?
Explain how the virtual base class is different from the conventional base classes of the opps.
What you know about structures in C++?
What are pointers used for c++?
What is input operator in c++?
What is the difference between #define debug 0 and #undef debug?
Evaluate as true or false: !(1 &&0 || !1) a) True b) False c) Invalid statement
What is the purpose of extern storage specifier?
What do you mean by funtion prototype?
Can turbo c++ run c program?