what is the differance between pass by reference and pass
by value.
Answers were Sorted based on User's Feedback
Answer / shalini
In the pass by reference we are using the pointer that is
here, we are passing only address where value is stored. but
in the case pass by value we are using ordinary variable
that is pass the value itself. here the value cannot be
changed in calling function and returning back to called
function but this is possible in call by reference
| Is This Answer Correct ? | 13 Yes | 0 No |
Answer / vijaya
in pass by value only the actual value of a variable is
copied to a formal parameter & it doesn't effects the
actual value when any operations r done on it
where
in pass by refference we r sending address of variables it
gives exact results but any oprations done on it may effect
actual values
| Is This Answer Correct ? | 9 Yes | 0 No |
Answer / srikanth
In pass by value we can pass value through the arguments
In pass reference with the help of operation
| Is This Answer Correct ? | 3 Yes | 1 No |
Answer / sowjanya
in pass by value method actual values of a variable are
copied to the formal arguments . modifications of these
values by performing some operations on it are not effect on
the actual value. i.e these modifications are not returned
to calling function.
in pass by reference method addresses of the actual
variables are copied to the formal arguments. modification
of these variable values effects the actual value by
returning these modifications to calling function.
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / 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 |
Answer / kiran
In Pass-by-value, changes made in the formal parameters will not reflect in actual parameters and vice-versa. Where as In Pass-by-reference, changes made in the formal parameters will reflect in actual parameters and vice-versa.
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / vasanth
pass by value :passing the varibles directly into function
augments
pass by reference:
passing the address of the pointer varible
| Is This Answer Correct ? | 0 Yes | 6 No |
What is a pointer variable in c language?
which is the best site or book for learning C...and i need the content for C..how to get the good programming skills....? can plz suggest me....
what are the 10 different models of writing an addition program in C language?
User define function contain thier own address or not.
Find occurence of a character in a sting.
What are the disadvantages of external storage class?
What is a void pointer in c?
how to write hello word without using semicolon at the end?
Why is c fast?
Explain what are the different data types in c?
main() { enum _tag{ left=10, right, front=100, back}; printf("%d, %d, %d, %d", left, right, front, back); }
Can a binary search tree be used as an index? If yes, how? Explain