(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 你可能也喜欢 JMS消息接口 2014年1月31日 城镇化忧思 问题6:数据库和服务器关键性能指标 Matplotlib风格与样式 ORACLE 数据泵expdp导出命令 impdp导入使用 AtCoder Beginner Contest 261 (ABC 261) B~F 题解 浅谈$(document)和$(window)的区别 Springboot项目请求乱码问题 HTTP响应代码中文详解 batocera_Batocera Windows游戏 AWB(Attention WaveBlock) 安全需求和挑战 jupyter notebook使用技巧 js获取url传递的参数(?号后面的参数) 图像 二值化 评价方法 工具 并行计算基础知识 渭南中学2021高考成绩查询,渭南市各高中2020年高考成绩喜报一览 input相关:点击时边框颜色去除、placeholder样式、点击时隐藏 数据库——SQL实验二 matlab GUI之常用对话框(三)— dialog \ errordlg \ warndlg \ helpdlg \ msgbox \questdlg