黑马程序员C++视频笔记(第三部分p167-p263)
P170 模板-函数模板案例-数组排序
#include <iostream>
using namespace std;
#include <string>//(1)只要涉及string打印输出要加此文件!!!
//定义函数模板
template<class T>//(2)注意这后面不加分号,它和下边函数实一个整体!!!
void mysort(T arr[], int len)
{
//(3)选择排序法
for (int i = 0; i < len...
原创
2020-06-09 01:21:18 ·
334 阅读 ·
0 评论