Call by reference:
Memory allocation process
w
void swap(int *x, int *y)
w
{
int temp;
w
w
temp = *x;
w
*x = *y;
w
*y = temp;
w
}
w
w
int main(){
w
int i = 10, j=6;
w
swap(&i, &j);
w
}
Call by value in this context
means when the execution
enters the body of swap, its
formal parameters are
initialised as if two
assignments are executed:
x = &i;
y = &j;