C++ 用宏实现swap(a,b)

#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