-4
我必须写2层的结构,这样的:两个结构具有相同可变
typedef struct {
const char max ;
char *val ;
const char *charray ;
const char *entstate ;
const char *entindex ;
const char escstate ;
const char escindex ;
} choice ;
typedef struct {
const int min ;
const int max ;
int *val ;
const char entstate ;
const char entindex ;
const char escstate ;
const char escindex ;
} remote ;
但这是否显示错误,即,有些像escstate
escindex
变量,的等,这些标识符在此已经使用码。显示此错误是因为enstate
已在结构choice
中定义,并且它在结构remote
中再次定义。但我需要结构为remote
的所有这些变量。它的解决方案是什么?
我刚刚粘贴你的代码到测试文件并没有错误编译.. – jimpic
请粘贴一个最小的可编译源代码。还包括您从编译器看到的确切错误消息。 – jweyrich
不,问题不在于你的结构,它可能是你的代码,你如何试图使用它们,但是你什么也没有显示。 struct(甚至是anopnymous)成员名称不会相互冲突。 – ShinTakezou