P
Peter Dunker
Hi,
I will write ANSI C89.
Is the following struct defenition correct ?
I wrote it with VC6(Windows IDE) and at first no Problem.
As I changed a compiler switch to 'no language extension',
the compiler said that the union has no name.
Is it right that in ANSI C the union must be named inside this kind of
structure ?
struct _S_ITEM
{
char *name;
int nb_of_bits;
int type;
PS_ITEM len_ref;
PS_DESCR hlp_des;
union {
struct{
void* p_value;
void* p_default;
}value;
struct{
char* name;
void* child;
}group;
struct{
PS_ITEM number_ref;
char* name;
char* id;
void* child;
}loop;
};
};
Thx Peter
I will write ANSI C89.
Is the following struct defenition correct ?
I wrote it with VC6(Windows IDE) and at first no Problem.
As I changed a compiler switch to 'no language extension',
the compiler said that the union has no name.
Is it right that in ANSI C the union must be named inside this kind of
structure ?
struct _S_ITEM
{
char *name;
int nb_of_bits;
int type;
PS_ITEM len_ref;
PS_DESCR hlp_des;
union {
struct{
void* p_value;
void* p_default;
}value;
struct{
char* name;
void* child;
}group;
struct{
PS_ITEM number_ref;
char* name;
char* id;
void* child;
}loop;
};
};
Thx Peter