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
Briefly describe a B+ tree. What is bulk loading in it?
write a c++ program to create class student having datamember name,Roll_no,age,and branch intilcization all the member using constructor print the all the details on the screen.
What are its advantages and disadvantages of multiple inheritances (virtual inheritance)?
What are pointers used for c++?
What happens when the extern "c" char func (char*,waste) executes?
What are c++ stream classes?
Why would you use pointers in c++?
What are formatting flags in ios class?
How did c++ get its name?
What do you mean by translation unit?
Write a program to encrypt the data in a way that inputs a four digit number and replace each digit by (the sum of that digit plus 7) modulus 10. Then sweep the first digit with the third, second digit with the fourth and print the encrypted number.
State the difference between delete and delete[].
What is the difference between strcpy() and strncpy()?
How would you call C functions from C++ and vice versa?
List the special characteristics of constructor.