void f1 ( int a, int b) { //This code is call by value
// hence no effect of actual values when run.
int c;
c = a;
a = b;
b = c;
}
void f2 ( int * a, int * b) { //*a= address of b
//and *b = address of c
int c; //int c = garbage
c = * a; //c = value at address a = 5;
*a = *b; //*a = Exchange original
// variable value of c to b = b= 6
*b = c; //*b = c = 5;
}
int main () {
int a = 4, b = 5, c = 6;
f1 ( a, b); This has no effect on actual values
// of a ,b since Call by value.
f2 (&b, &c); Here change will be happen.
At this point int a = 4, b = 6, c = 5;
printf ("%d", c - a - b); = (5-4)-6 = 1-6 = -5
}