标签:ret 异或 argc std argv nbsp turn const int
//通过位异或来交换a,b的值
#include <stdio.h>
int main(int argc, const char * argv[]) {
int a=20,b=10;
a=a^b;
b=b^a;
a=a^b;
printf("%d",a);
printf("%d\n",b);
return 0;
}
//通过c来交换
#include <stdio.h>
int main(int argc, const char * argv[]) {
int a=20,b=10,c;
c=a;
a=b;
b=c;
printf("%d",a);
printf("%d\n",b);
return 0;
}
标签:ret 异或 argc std argv nbsp turn const int
原文地址:http://www.cnblogs.com/wangjinshan/p/7067011.html