What is the difference function call by value & function
call by reference?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain what are its uses in c programming?

588


Differentiate between static and dynamic modeling.

610


What is the description for syntax errors?

606


What is dynamic memory allocation?

800


Explain what are header files and explain what are its uses in c programming?

621






How old is c programming language?

569


Is struct oop?

573


What does a derived class inherit from a base class a) Only the Public members of the base class b) Only the Protected members of the base class c) Both the Public and the Protected members of the base class d) .c file

654


Why is sprintf unsafe?

612


An integer that indentifies the position of a data item in a sequence of data items a) value b) number c) index d) all of the above

642


what is use of malloc and calloc?

1374


Here is a neat trick for checking whether two strings are equal

558


Explain setjmp()?

649


What does %p mean?

583


What are keywords c?

594