template <typename T> void myswap(T& a,T& b) { T temp = a; a = b; b = temp; } int _tmain(int argc, _TCHAR* argv[]) { int a = 3; int b = 5; myswap(a,b); double c = 3.2; double d = 5.9; myswap(c,d); cout<<"before myswap(a,b) =("<<a<<","<<b<<")"<<"after myswap(a,b) =("<<a<<","<<b<<")"<<endl; cout<<"before myswap(c,d) =("<<c<<","<<d<<")"<<"after myswap(c,d) =("<<c<<","<<d<<")"<<endl; system("pause"); return 0; } template函数的练习......