2017年11月7日

函数:显式具体化模板函数 引用结构

摘要: #include template void Swap(T &a, T &b);struct job{ char name[40]; double salary; int floor;};template void Swap(job &j1, job &j2);vo... 阅读全文

posted @ 2017-11-07 09:24 MACHINE_001 阅读(84) 评论(0) 推荐(0) 编辑

函数:使用函数模板,泛型引用,重载进行数据交换

摘要: #include template void Swap(T *a, T *b, int n);template void Swap(T &a, T &b);void Show(int a[]);const int Lim = 8;int main(void){ usi... 阅读全文

posted @ 2017-11-07 08:30 MACHINE_001 阅读(137) 评论(0) 推荐(0) 编辑

函数:模板的使用

摘要: #includetemplate void Swap(T &a, T &b);int main(void){ using std::cout; int i=10, j=20; cout void Swap(T &a, T &b){ T temp; temp = a... 阅读全文

posted @ 2017-11-07 08:11 MACHINE_001 阅读(66) 评论(0) 推荐(0) 编辑

导航