Liangliang Nan (南亮亮)分享 http://blog.sciencenet.cn/u/LiangliangNan 细推物理须行乐,何用浮名绊此身

博文

C/C++结构体的前向声明

已有 8860 次阅读 2014-7-10 04:11 |系统分类:科研笔记| 结构体, forward, 前向声明, struct, declaration

  1. // 定义 MyMatrix 结构体类型

  2. typedef struct MyMatrixType {  

  3. // define member functions and variables 

  4. } MyMatrix;  

  1. // 定义 HisMatrix 结构体类型

  2. struct HisMatrix {  

  3. // define member functions and variables 

  4. };  


  1. // 定义 YourMatrix 类类型

  2. class YourMatrix {  

  3.    // define member functions and variables

  4. };  

  5.  

  6. //其他文件中的前向声明,注意结构体和类的区别  

  7. typedef struct MyMatrixType MyMatrix;

  8. struct HisMatrix;

  9. class  YourMatrix;  




https://blog.sciencenet.cn/blog-562235-810452.html

上一篇:CGAL::min_rectangle_2()的使用
下一篇:在LaTex中调整断字(hyphenation)
收藏 IP: 109.171.137.*| 热度|

1 Vetaren11

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-6-16 13:11

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部