直接上代码
#include "stdafx.h"
#include <iostream>
using namespace std;
void Swap(int& i32tempA, int& i32tempB)
{
i32tempA = i32tempA^i32tempB;
i32tempB = i32tempA^i32tempB;
i32tempA = i32tempB^i32tempA;
}
int _tmain(int argc, _TCHAR* argv[])
{
int i32tempA = 10;
int i32tempB = 5;
Swap(i32tempA, i32tempB);
return 0;
}