摘要:
1 template 2 void swap(T &a,T &b) 3 { 4 T temp=a; 5 a=b; 6 b=temp; 7 } 8 int add(double a,double b) 9 {10 return a+b;11 }12 int main()13 {14 int ia=3;15 double db=5.0;16 char s1[]="good",s2[]="better";17 int x=add(ia,db);18 /*swap(ia,db);19 swap(s1,s2);*/20 }... 阅读全文