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


Please Help Members By Posting Answers For Below Questions

What is floating point constants?

701


What are the characteristics of arrays in c?

622


What is memcpy() function?

630


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

777


What is meant by type specifiers?

670






When is a null pointer used?

648


Is calloc better than malloc?

595


What are local static variables?

629


What do you understand by friend-functions? How are they used?

659


What will be your course of action for a push operation?

671


How can you call a function, given its name as a string?

724


How can I ensure that integer arithmetic doesnt overflow?

616


What is the equivalent code of the following statement in WHILE LOOP format?

778


Can we change the value of #define in c?

592


Explain how do I determine whether a character is numeric, alphabetic, and so on?

662