(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 你可能也喜欢 在idea上配置多个端口启动web应用 Ubuntu14.04 源码编译安装ejabberd15.04 【填坑/xdoj难题集】xdoj 2018校赛 现场赛 H敬老师的手环2 Android 获取屏幕和控件大小 FreeRTOS调度器挂起与解除 Docker基础学习 pip安装TensorFlow-GPU时报错,该如何解决? JQuery选择器—–属性选择器 准确率、精确度、召回率以及F1值的理解和作用 高度兼容低版本的 antd 的动态主题方案 850pro测试软件,三星850Pro系列SSD介绍 报错:The Apache Tomcat installation at this directory is version 8.5.27. A Tomcat 8.0 installation is Hadoop100:大数据平台安装部署–CDH6.2版本【集群】 Ansible-playbook一键安装docker Runtime.getRuntime.exec()使用 # LoongArch 内存模型与栅障 Android源码之init.rc文件详解 No module named ‘sklearn.cross_validation‘ h5plus设置安卓底部虚拟按键背景颜色 [源码和文档分享]基于JSP实现的在线投票系统