Home » C Programming » Call by value and Call by reference in C Programming

Call by value and Call by reference in C Programming

There are two ways to pass arguments in a function

  1. Call by value
  2. Call by reference

Lets see above one by one

Call by value

Whenever we call a function and passes the value of variable to the called function is called call by value.

OUTPUT

Call by reference

Whenever we call a function and passes the reference of variable to the called function is called call by reference.

In the call by reference, to pass the reference of the variable we use pointer.

OUTPUT

Managed by MochaHost - Fast & Easy WordPress Hosting