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

What are the features of the c language?

656


Is sizeof a keyword in c?

588


Can you please compare array with pointer?

625


write a program that reads lines(using getline), converts each line to an integer using atoi, and computes the average of all the numbers read. also compute the standard deviation.

1991


Explain the array representation of a binary tree in C.

736






What is page thrashing?

659


What does typeof return in c?

648


Explain about C function prototype?

617


Why header files are used?

656


What is the process of writing the null pointer?

613


What is a structure in c language. how to initialise a structure in c?

617


What could possibly be the problem if a valid function name such as tolower() is being reported by the C compiler as undefined?

765


Can I use base-2 constants (something like 0b101010)? Is there a printf format for binary?

584


What is wrong with this declaration?

619


List some basic data types in c?

572