Argument passing is a technique for transferring data and information between the calling and called function. There are two ways to pass arguments to the called function:a)Call by Value b)Call by reference.
Call by Value:
The call by value method is default technique of passing arguents.In this method only the copies of the caller’s variables are sent to the callee’s variables means a photocopy of actual arguments are passed to called function.
Call by Reference(Address):
When the arguments listed in a function call are pointers, the memory address of the caller’s variables are transmitted to the function means the address of actual arguments of calling function are copied into formal arguments of called function.
change(int *x,int *y)
Three things that must be kept in mind while passing arguments are:
1)Number of arguments in the caller and callee function must be same.
2)Order of the arguments in caller and callee function should match.
3)The data type of actual and formal arguments should be same in both the caller and callee function. Any mismatch in the data type will produce unexpectedmresults.