转 : c++ 结构体 前向声明

 1 typedef struct tag_guid
 2 {
 3     ULONGLONG utime;
 4     ULONGLONG umac;
 5 }tpguid;
 6 
 7 class A
 8 {
 9 private:
10     int m_teset1;
11 };
12 
13 //其他文件中的前向声明,注意结构体和类的区别
14 typedef struct tag_guid tpguid;
15 class A;
16 
17 //使用,注意使用前向声明的成员必须是指针
18 class B
19 {
20 private:
21     tpguid*    m_guid;
22     A*         m_a;
23 };


转:http://blog.csdn.net/rabbit729/article/details/7056415
原文地址:https://www.cnblogs.com/kira2will/p/3448179.html