#include<stdio.h>
void swap(int *a, int*b)
{
int*temp = a;
a = b;
b = temp;
}
int main()
{
int x = 10, y = 5;
printf("运算前:\nx=%d,&x=%p;y=%d,&y=%p\n", x, &x, y, &y);
swap4(&x, &y);
printf("运算后:\nx=%d,&x=%p;y=%d,&y=%p\n", x, &x, y, &y);
}
请问为什么这个函数不能做到,x,y值的交换,还有x,y地址的交换