what is the differance between pass by reference and pass
by value.
Answer Posted / achal ubbott
When we use 'pass by value' method, acopy of the object is
sent to the called function. So the copy constructor of the
object gets called. But the called function cannot modify
the content of the original object.
But references of an object are like alias. When 'pass by
reference ' is used it is actually using address at the
underlying. This way the called function may modify the
contents of the original object since operations are being
performed over the same object using its address, not on
the copy.
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is meant by preprocessor in c?
What does == mean in texting?
what is the significance of static storage class specifier?
What is page thrashing?
What is function and its example?
Explain how can I right-justify a string?
Which one would you prefer - a macro or a function?
I have a varargs function which accepts a float parameter?
What is your stream meaning?
Where static variables are stored in c?
Which header file is used for clrscr?
Explain how can you tell whether a program was compiled using c versus c++?
What is the difference between volatile and const volatile?
How can I direct output to the printer?
Explain what are run-time errors?