当我们以这种方式修改交换函数时会发生什么?我知道这行不通,但到底是怎么回事?我不了解我实际上做了什么?
#include <stdio.h>
void swap(int*, int*);
int main(){
int x=5,y=10;
swap(&x, &y);
printf("x:%d,y:%d\n",x,y);
return 0;
}
void swap(int *x, int *y){
int* temp;
temp=x;
x=y;
y=temp;
}
在功能中