首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

联合体union未定义?解决办法

2012-03-18 
联合体union未定义?//以下为类A#includeB.htypedef union{int aint b}def_tclass A{}//以下为类B#in

联合体union未定义?
//以下为类A
#include<B.h>
typedef union{
  int a;
  int b;
}def_t;
class A{

};
//以下为类B
#include<A.h>
class A;
class B{
 def_t def;
};

为什么报def_t未定义啊?


[解决办法]

C/C++ code
typedef union tagDef_t{  int a;  int b;}def_t;
[解决办法]
为什么类A中要#include<B.h>?

热点排行