swap函数用法
#include<stdio.h>main()
{
int a,b;
int *pointer1,*pointer2;
scanf("%d,%d",a,b);
pointer1=&a;
pointer2=&b;
swap(pointer1,pointer2);
printf("The result is :%d,%d\n",a,b);
}
请问这个代码为什么不能编译,谢谢!
void swap(int *a,int *b) { int temp; temp=*a; *a=*b; *b=temp; }