不同类如何共用一个结构体 类 A ,B机构体 MyStruct如何在A,B中分别生命两个 MyStruct 的机构体变量?主要是 MyStruct 该在哪里声明A.h or B.h or MyStruct.h我都试过了,都搞不定 ~@~谢了先~ 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 MyStruct.h定义MyStruct,A.h B.h中include"MyStruct.h"应该可以吧? 方案:MyStruct.h 声明结构体A,B中都包含MyStruct.h 绝招:两个A,B头文件中都定义另可能是重复头文件包含,这样的话得在MyStruct.h,里面使用#inndef #define #endif啦 不行的struct' type redefinition~@~ 重复头文件包含,这样的话得在MyStruct.h,里面使用#inndef #define #endif#inndef "MyStruct_h"#define "MyStruct_h"struct{.............}#endif 搞定了#infdef MyStruct_h#define MyStruct_hstruct MyStruct{ .............}#endif谢谢各位了^@^ windows核心编程 vc2005 LIST CONTROL 颜色设置问题 急!dispinterface类型的接口不能使用queryinterface()查询? MFC Dialog窗口程序的问题... 发送关于单击按钮的信息,sendmessage()的参数怎么填? 如何做一个复杂运动用d3d?手工计算matrix???? XML如何存储二进制数据?来者有分啊 我也投诉。大家来看看马甲是如何倒分的! 救命阿,麻烦哪位高手看一下 如何将数据保存成后缀名.sam.spc格式的文件 VC绘图函数问题 HELP:WinsockC/S模式关闭问题
A.h B.h中include"MyStruct.h"
应该可以吧?
MyStruct.h 声明结构体
A,B中都包含MyStruct.h
struct' type redefinition
~@~
#inndef "MyStruct_h"
#define "MyStruct_h"
struct{
.............
}
#endif
#infdef MyStruct_h
#define MyStruct_h
struct MyStruct{
.............
}
#endif
谢谢各位了^@^