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
Is void a keyword in c?
int far *near * p; means
What are the salient features of c languages?
Explain main function in c?
What is the difference between ++a and a++?
What is data structure in c programming?
What is void main ()?
Explain which of the following operators is incorrect and why? ( >=, <=, <>, ==)
Why static is used in c?
What is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?
Is there sort function in c?
What is the ANSI C Standard?
List the difference between a "copy constructor" and a "assignment operator"?
Is a pointer a kind of array?
Why C language is a procedural language?