HI All;
I am having a problem changing the value of an enum. I have a struct as shown below:
Now i have an array of this struct say:
cdr_t array[4];
array[0].u2.iS=1;
When i try to change the value of the enum "iS" in the struct i get an error saying that """"" Invalid conversion from int to cdr_t ::<anonymous
union>::<anonym ous enum>'""""""
Please help. Its a c++ programme.Thank s in advance.
I am having a problem changing the value of an enum. I have a struct as shown below:
Code:
typedef struct { union { long lV; volatile char c[8]; } u1; union { enum { CDR_RESET, CDR_ON, CDR_DISARMED } iS; volatile char c[8] } u2; } cdr_t;
cdr_t array[4];
array[0].u2.iS=1;
When i try to change the value of the enum "iS" in the struct i get an error saying that """"" Invalid conversion from int to cdr_t ::<anonymous
union>::<anonym ous enum>'""""""
Please help. Its a c++ programme.Thank s in advance.
Comment