利用异或运算进行两个变量内容的交换,程序崩溃,求解~交换程序为:void inplace_swap(int *x,int *y){*x *
利用异或运算进行两个变量内容的交换,程序崩溃,求解~
交换程序为:
void inplace_swap(int *x,int *y)
{
*x = *x ^ *y;
*y = *x ^ *y;
*x = *x ^ *y;
}
void mian()
{
int *i=2,*j=3;
inplace_swap(i,j);
return ;
}
[解决办法]
