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 are the 4 types of programming language?
What is function prototype in c with example?
Why static is used in c?
When should structures be passed by values or by references?
How was c created?
Can we use visual studio for c?
What is data type long in c?
How can my program discover the complete pathname to the executable from which it was invoked?
What oops means?
in case any function return float value we must declare a) the function must be declared as 'float' in main() as well b) the function automatically returned float values c) function before declared 'float' keyword d) all the above
Why is c called a mid-level programming language?
while loop contains parts a) initialisation, evalution of an expression,increment /decrement b) initialisation, increment/decrement c) condition evalution d) none of the above
What are examples of structures?
How can you return multiple values from a function?
What is calloc() function?