#include <iostream>
using namespace std;
#define SWAP(a,b) a^=b,b^=a,a^=b
int main(void){
int x = 2,y=3;
SWAP(x,y);
cout << x << ',' << y << endl;
return 0;
}
转载于:https://www.cnblogs.com/niie9/p/6182556.html
最后
以上就是清爽咖啡豆最近收集整理的关于C++ 用宏实现swap(a,b)的全部内容,更多相关C++内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复