Structure - Typedef accessing problem
Hi,
Code:
typedef enum RelationalOperators {EQ, NE, GT, LT} Rel_Op;
Code:
typedef union TokenAttribute{
Rel_Op rel_op;
} TA;
Code:
typedef struct Token
{
TA attribute;
} Token;
Code:
token temp;
temp.attribute.rel_op[0]; /*error*/
i am trying to access the EQ, NE, GT, and LT to do certain operations afterwards - but cant seem to get the syntax right...
Structure - Typedef accessing problem
<<threads merged>>
Code:
typedef enum RelationalOperators {EQ, NE, GT, LT} Rel_Op;
typedef union TokenAttribute{
Rel_Op rel_op;
} TA;
typedef struct Token
{
TA attribute; /* token attribute */
} Token;
Code:
Token temp;
temp.attribute.rel_op[0]; /*error*/
I have been trying ti access the rel_op as i need to compare the content...but cant seem to get the syntax right...