(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 你可能也喜欢 ReentrantReadWriteLock读写锁底层实现、StampLock详解 1011 A+B和C 【工业互联网】康鹏举:工业互联网平台的技术内核与创新应用 JDK1.8怎么解决HashMap死循环的问题? docker 部署redis 并设置密码 被收购前的最后荣光——200G Mellanox QM8700 Infiniband 交换机简评 HttpRunner框架(一) 006.合宙ESP32-C3+蓝牙调试器通过BLE发送接收数据教程 C++ 变量、常量、符号常量 微服务基础 node-sass安装不成功 leetcode刷题分类笔记-代码随想录顺序总结 洛谷P4317 花神的数论题(数位DP) ArcGIS Engine二次开发中有关内存泄漏异常的解决方法 RestTemplate.getForObject方法 OSPF动态路由协议的配置命令 tolower函数 jupyter notebook nbextension常用扩展模块不显示 千万不要追求“稳定”,只有“穷”才是稳定的,你要它干啥? FreeRTOS–API函数(翻译整理)