(20201219)C++中类模板的.hpp形式 Post author:xfxia Post published:2023年8月26日 Post category:其他 20201219 参考: 【1】 https://blog.csdn.net/u010608296/article/details/102483031 【2】 http://blog.chinaunix.net/uid-24118190-id-75239.html 【3】 https://www.jianshu.com/p/70ca94872418 【4】 http://c.biancheng.net/cpp/biancheng/view/2992.html test.h #pragma once #include <iostream> #include <stdlib.h> using namespace std; template<typename T> class c_show { public: void show(T data[]); }; test.hpp #include "test.h" template<typename T> void c_show<T>::show(T data[]) { cout << data[0] << endl; } main.cpp #include <iostream> #include "test.hpp" int main() { c_show<double> c_show; double data1[10] = { 0.0,1,2,3,4,5,6,7,8,9 }; c_show.show(); system("pause"); return 0; } 版权声明:本文为sinat_32602421原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。 原文链接:https://blog.csdn.net/sinat_32602421/article/details/111403625 你可能也喜欢 14-ROS参数的学习与使用 leetcode-验证二叉搜索树 资料分享|常用AD元件库及封装库 Linksys WRT1900ACS刷OpenWrt 关于大米时代提高班的深刻思考–(7) pic图片怎么换jpg格式_PNG图片怎么转换成JPG?这招教你完美解决 示例:Scala读取文件和网络数据 OpenGL默认的render target HBase数据存储格式 【编程练习】求和 Hbase 查询命令 条件筛选 springCloud-服务隔离Hystrix 现代密码学之安全多方计算 关于蓝桥杯单片机 官方例程 矩阵按键 消抖原理 ‘s 解释 v-on的用法 GNN Graph Isomorphism方向探索 【背景音乐单击音乐图标,实现音乐的暂停与播放。】 UE4搭建标准光照环境 Incorrect string value错误解决 windows家庭版 安装 wsl 2失败,总结