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 floating point constants?
What are the characteristics of arrays in c?
What is memcpy() function?
the process of defining something in terms of itself is called (or) in C it is possible for the functions to call themselves. A function called a) nested function b) void function c) recursive function d) indifinite function
What is meant by type specifiers?
When is a null pointer used?
Is calloc better than malloc?
What are local static variables?
What do you understand by friend-functions? How are they used?
What will be your course of action for a push operation?
How can you call a function, given its name as a string?
How can I ensure that integer arithmetic doesnt overflow?
What is the equivalent code of the following statement in WHILE LOOP format?
Can we change the value of #define in c?
Explain how do I determine whether a character is numeric, alphabetic, and so on?