hi, masters, I've a beginner with C, here I encountered a problem, and hope someone can help me understand it:
Why the following codes is wrong:
void swap(int x, int y) /* WRONG */
temp = x;
x = y;
y = temp;
The book gives the explanation as: "Since C passes arguments to functions by value, there is no direct way for the called function to alter a variable in the calling function." but I cannot quite understand it.