"Call by Reference" is the other method supported by C, where the argument to be communicated is passed via an address. Again, the address of the argument (variable) and not the (variable's) value is passed. The function can modify the argument since it has its address!
x = 1; SetToZero(x); ... void SetToZero(int var) { var = 0; }This will:
x = 1; SetToZero(&x); ... void SetToZero(int *varPtr) { *varPtr = 0; }
void SwapIntegers (int *p1, int *p2) { int temp; temp = *p1; *p1 = *p2; *p2 = temp; }