#pragma region swaps.8.4
//程序清单8.3
//swaps.cpp – swapping with refferences and with pointers
#if 0
#include
void swapr(int& a, int& b);//a,b are aliases for ints
void swapp(int* p, int* q);//p,q are addresses of ints
void swapv(int a, int b);//a,b are new wariables
int main()
{
using namespace std;
int wallet1 = 300;
int wallet2 = 350;
cout << “wallet1 = $” << wallet1;
cout << " wallet2 = $" << wallet2 << endl << endl;
cout << "Using references to swap contents:\n";
swapr(wallet1, wallet2);//pass variables
cout << "wallet1 = $" << wallet1;
cout << " wallet2 = $" << wallet2 << endl << endl;
cout << "Using pointers to swap contents again:\n";
swapp(&wallet1, &wallet2);//pass addresses of variables
cout << "