swap 程序输出错误
swap(int *a, int *b){
int temp;
temp = *a;
*a = *b;
*b = temp;
}
int main()
{
int a, b;
int *pointer1, *pointer2;
scanf("%d,%d", &a, &b);
pointer1=&a;
pointer2=&b;
swap(pointer1, pointer2);
printf("\nThe result is:%d,%d\n",a,b);
getch();
return 0;
}
这个代码怎么输出a一直都是小数,请哪个高手指点一下,谢谢!