F
Frank Roland
I know it is possible to use unnamed struct or unions inside of struct like
in the following example:
typedef struct {
union {
int moin;
char carl;
};
int bon;
} dastruct;
int main(int argc, char * argv[])
{
dastruct thestruct;
thestruct.carl = 'a';
thestruct.bon=6;
...
Now I have a compiler which does not allow me to acces moin or carl unless I
give the union a name, like here:
typedef struct {
union {
int moin;
char carl;
} x;
int bon;
} dastruct;
int main(int argc, char * argv[])
{
dastruct thestruct;
thestruct.x.carl = 'a';
thestruct.bon=6;
....
What I wonder is, wheter unnamed struct and unions are a feature of newer C
standard (C99)?
Kind regards,
Frank
in the following example:
typedef struct {
union {
int moin;
char carl;
};
int bon;
} dastruct;
int main(int argc, char * argv[])
{
dastruct thestruct;
thestruct.carl = 'a';
thestruct.bon=6;
...
Now I have a compiler which does not allow me to acces moin or carl unless I
give the union a name, like here:
typedef struct {
union {
int moin;
char carl;
} x;
int bon;
} dastruct;
int main(int argc, char * argv[])
{
dastruct thestruct;
thestruct.x.carl = 'a';
thestruct.bon=6;
....
What I wonder is, wheter unnamed struct and unions are a feature of newer C
standard (C99)?
Kind regards,
Frank