Example:
#include<stdio.h>
void swap(int x, int y)
int t;
t = x;
x = y;
y = t;
}
int m = 10, n = 20;
printf("Before executing swap m=%d n=%d\n", m, n);
swap(m, n);
printf("After executing swap m=%d n=%d\n", m, n);
Output:
Before executing swap m=10 n=20
After executing swap m=10 n=20
Explanation:
In the main function, value of variables m, n are not changed though they are passed to function 'swap'. Swap function has a copy of m, n and hence it can not manipulate the actual value of arguments passed to it.