(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 你可能也喜欢 【无标题】 pycharm输出中文出现乱码的几种解决方法以及读取时打印出现乱码的解决 EC2简介 JS中for循环嵌套switch时break引发的BUG!!! 邮件协议rfc822文档 从LM3S到LM4F TM4C ARM Cortex-M4 : grlib图形显示 C 语言从入门到精通教程(2021 ) Ubuntu下配置Nginx HTTPS 非Controller层通过RequestContextHolder.getRequestAttributes()获取HttpServletRequest,HttpServletRespon空指针问题 Spring Cloud简介以及版本选择 Android Studio版本更新后 或 导入他方项目后 build失败或缓慢等的一系列问题解决 c\c++如何解决读取txt(文本文件)中文乱码现象 [C++]最小生成元 (Digit Generator, ACM/ICPC Seoul 2005, UVa1583) Spring Boot文档翻译 C# Redis实战 HTTP——超文本传输协议 史上最详细axios,读完你就全部懂了 IPv4与IPv6的互操作性 A-B数对—–洛谷 [剑指offer刷题] AcWing 50. 序列化二叉树