C programming function arguments

C programming function arguments also known as parameters are the variables that will receive the data sent by the calling program. These arguments serve as input data to the function to carry out the specified task.

Description of C programming function arguments

Here, as shown in the figure above arguments_value is used to send values to the called program.

Example of passing arguments by value to function in C

In this program, function add() is called by passing the arguments x and y.

The copy of the values of x and y are passed to a and b respectively and then are used in the function.

So by changing the values of a and b, there will be no change in the actual arguments x and y in the function call.

Pass by reference

Pass by reference is a method in which rather than passing direct value the address of the variable is passed as an argument to the called function.

When we pass arguments by reference, the formal arguments in the called function becomes the assumed name or aliases of the actual arguments in the calling function. So the function works on the actual data.