结构可以在不同类中重复定义吗?需要什么样的条件? 包含你所定义结构的文件就可以了e.g#include "thestruct.h" 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 可以class class1{ int x;public: struct struct1{ int x; int y; };};class class2{ int x;public: struct struct1{ int x; int y; int z; };};Then you could use class1::struct1 and class2::struct1 at the same time.And you could use namespace too. 当然可以,最好的做法是你用namespace 使用namespace,在class1中使用一个namespace1,class2中使用namespace2. 怎么屏蔽一些字眼,屏蔽一些工具? Winpcap问题 bho控制IE的几个问题 如何监控一个进程,当发现该进程已关闭后,自动重新启动该进程! atlimage.h 怎么找不到啊?\ATL\INCLUDE中没有啊,急!!! 在一个Mouse或KeyBoard的钩子DLL里怎么判断当前的焦点窗口 我要装IIS服务,但又没有2000的光盘,哪位知道从那可以找到IIS? 一个很头痛的问题,Socket 对象锁不住 我刚学VC,想问问怎样在VC中调试我写的C程序? 分数不多,请教高手(局域网) 怎么在对话框上加一个splitter view 请教TLS的问题
class class1{
int x;
public:
struct struct1{
int x;
int y;
};
};class class2{
int x;
public:
struct struct1{
int x;
int y;
int z;
};
};Then you could use class1::struct1 and class2::struct1 at the same time.
And you could use namespace too.
class2中使用namespace2.