(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 你可能也喜欢 没有静态资源的SpringMVC根路径访问处理 过滤器filter 浅谈tomcat路径配置原理 使用 ElementPlus 组件时,遇到的一些问题及解决方案 牛客网 找到搜索二叉树中两个错误的节点 【算法】《算法竞赛入门经典》第二章 示例及答案 css动画实现图片渐显,用CSS3 transition属性实现淡入淡出轮播图 helm部署skywalking实战 Springboot常用注解 使用iText填充pdf表单 调整undo表空间 Android 获取对话框返回值 正则表达式详解 解决RuntimeError:Error(s)in loading state_dict for YoloBody 一篇带你详解static关键字(超详细) ARP 防御措施 oracle写会阻塞读吗,oracle读不阻塞写带来的问题 LeetCode解题的常见模式套路 Go中TLS源码学习(1)之Https服务端框架详解 XP创建新管理员后无法删除的解决办法 1363: [蓝桥杯2018初赛]航班时间 去除图像竖直(垂直)条纹算法