函数模版
来源:互联网 发布:阿呆喵 知乎 编辑:程序博客网 时间:2024/05/01 14:03
#include <iostream>using namespace std;template <class T>//等价于template <typename T>void printArray(const T* tempArray,int count){for(int i=0;i<count;i++){cout << " " << tempArray[i];if((i+1)%15==0)cout << endl;}cout << endl;}int main(){const int ACOUNT = 5;const int BCOUNT = 6;const int CCOUNT = 7;int a[ACOUNT] = {2,3,4,5,6};double b[BCOUNT] = {1.2,2.3,3.4,4.5,5.6,6.7};char c[CCOUNT] = "Hello";cout << "array a contains :" << endl;printArray(a,ACOUNT);cout << "array b contains :" << endl;printArray(b,BCOUNT);cout << "array c contains :" << endl;printArray(c,CCOUNT);system("pause >> cout");return 0;}
0 0
- 模版函数
- 模版函数
- 模版函数
- 函数模版
- 函数模版
- 函数模版
- 函数模版
- 模版函数
- 函数模版
- 模版函数
- 函数模版
- 函数模版与模版函数
- 模版——函数模版、类模版
- 类模版中函数模版
- 函数模版与类模版
- 函数模版和类模版
- 模版笔记001 - 函数模版
- 函数模版和类模版
- 数据库事务隔离级别
- 类中方法的分类和实现
- 面试算法题目
- 将.rpm包转.deb包,并查看.deb包内容
- Linux 互斥锁
- 函数模版
- PowerDesigner 15安装截图
- 本体库可视化展示
- WWDC 2014 Session笔记 - iOS界面开发的大一统
- 快速排序
- 大型网站的架构概要
- window.open() 被拦截后的分析
- Excluding warnings using @SuppressWarnings
- 类模版