(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 你可能也喜欢 Anaconda报错——-PermissionError: [Errno 13] Permission denied 最小二乘蒙特卡洛模拟方法-美式期权定价 高级CSS属性实现的瀑布流的三种方法 树莓派——显示设置 bzoj 3073: [Pa2011]Journeys 线段树优化建图+堆优化dij gan判别器的loss接近零_GAN——随笔记录 js中this指向 ubuntu服务器版本无法显示,Ubuntu 18.04 LTS每日构建版默认依然使用X.org显示服务器… 如何在二维或三维地图中叠加一个视频(以mapboxgl为例) 微信支付 V3 开发教程(一):初识 Senparc.Weixin.TenPayV3 c3p0连接池和druid连接池的使用 c# datetime._C#| DateTime.Month属性与示例 matlab 使用plotyy,多柱状图,多折线图并存 Oracle Data Guard 理论知识 学校计算机机房网络设备,[学校计算机机房的维护]学校计算机机房硬件设备清单… 类与对象学习总结 springboot项目整合分布式定时任务Quartz SpringCloud结合Nacos注册中心及其熔断使用 Kotlin 学习 8、Spring Boot尚硅谷笔记整理——自定义starter