What is the difference function call by value & function
call by reference?
Answers were Sorted based on User's Feedback
Answer / nakul sharma
In Call by value we simply passes the variable to the
function but in CAll by reference we actually pass the
memory address where the variable we want to pass is stored.
Is This Answer Correct ? | 9 Yes | 0 No |
Answer / sona
In call by reference we provide address of another variable
In call by value we directly assigned value to variable
Is This Answer Correct ? | 9 Yes | 1 No |
In call by value,the function arguements will be duplicated
and sent to the called function from the function which is
calling it.
In call by reference ,the function arguements' address will
be passed to the called function by the calling function.
This method is the best practice since address is passed
rather than value.
Is This Answer Correct ? | 3 Yes | 0 No |
Answer / rahul
In call by value function, the value of the actual
parameters or arguments from calling function is passed on
to the called functions i.e. actual value is copied into the
formal parameters of called function. The arguments passed
may be variables of any data type or constants also.
In call by reference, the address of actual parameters are
passed on to the called functions from calling functions.
So, the values stored in these memory locations can be
altered, which is reflected in calling functions also.
Is This Answer Correct ? | 2 Yes | 0 No |
Answer / sangeetha
In call by value, the changes made in the formal arguments
does not affect the actual argument
In call by reference, the changes made in the formal
arguments does affect the actual argument
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / abirami
function call by refernce will be begin with "&" symbols.i
think sooo..
but i dont know to explain function call by values!!!!!!!
Is This Answer Correct ? | 3 Yes | 5 No |
x=2,y=6,z=6 x=y==z; printf(%d",x)
13 Answers Bharat, Cisco, HCL, TCS,
Write a function which takes as parameters one regular expression(only ? and * are the special characters) and a string and returns whether the string matched the regular expression.
write a program for size of a data type without using sizeof() operator?
22 Answers HCL, IBM,
What is the purpose of the statement: strcat (S2, S1)?
write the program to find multiplication of 2-D matrix??????????
Give basis knowledge of web designing ...
What does sizeof return c?
the statement while(i) puts the entire logic in loop. this loop is called a) indefinite loop b) definite loop c) loop syntax wrong d) none of the above
How can I get Single byte from 'int' type variable? Can we alter single bit or multiple bits in int type variable? if so, How?
Difference between Function to pointer and pointer to function
Which node is more powerful and can handle local information processing or graphics processing?
3. When do you say that a digraph is acyclic A)if and only if its first search does not have back arcs B)a digraph is acyclic if and only if its first search does not have back vertices C)if and only if its first search does not have same dfnumber D)None of these