(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 你可能也喜欢 集合的相关概念(开闭、有界无界、内点边界点等) C语言:输入正整数n,输出1 + 2 + … + n的值。 SpringBoot运行原理浅析 Android – Android Studio 3.0 问题总览记录 四大域总结 在ROS中使用UST-10雷达 陀螺产业区块链第六季 | 基于蒙正链-人工智能智慧农场农产品溯源 粗糙集的基础理论汇总 o.a.catalina.core.ContainerBase.[Tomcat].[localhost].[/demo].[dispatcherServlet] – Servlet.service() ckeditor使用—-跳坑之旅 6-12图-有向无环图(DAG图) solaris 命令大全 poj_2528_线段树+离散化+lazy Swift 与OC之桥接文件 容器技术:Docker搭建(通俗易懂) 在spring应用中使用shiro框架关于session解析 sys.path.append(os.path.abspath(”)) TransactionStatus().setRollbackOnly(); 轻松使用自己的回调函数 【SSM框架】Spring笔记 — 事务详解