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
In C language what is a 'dangling pointer'?
Is c procedural or object oriented?
What is context in c?
What is a shell structure examples?
How can you check to see whether a symbol is defined?
Write a function that will take in a phone number and output all possible alphabetical combinations
Why double pointer is used in c?
What is the use of bitwise operator?
Is c is a procedural language?
What is FIFO?
what is different between auto and local static? why should we use local static?
Describe the header file and its usage in c programming?
What are the output(s) for the following ? #include char *f() {char *s=malloc(8); strcpy(s,"goodbye")} main() { char *f(); printf("%c",*f()='A'); }
Is void a keyword in c?
How can I get back to the interactive keyboard if stdin is redirected?