Out parameters in C
问题 void swap(int &first, int &second){ int temp = first; first = second; second = temp; } ////// int a=3,b=2; swap(a,b); In the above example, the C compiler complaints that "void swap(int &first, int &second)" has a syntax error like missing "&" before "( / {". I don't understand why? Doesn't C support this feature? 回答1: C doesn't support passing by reference. So you will need to use pointers to do what you are trying to achieve: void swap(int *first, int *second){ int temp = *first; *first =