array address - Expression must be modifiable lvalue -


typedef struct state1_s {     u8 size;     u8 state; } state1_t; typedef struct state2_s {     u8 size;     u8 state[2]; } state2_t; typedef struct state3_s {     u8 code;     u8 count; }state3_t; 

i have these 3 structures. when following

state1_t comp[8]; state2_t *avail; state3_t *health;  &comp = (state1_t *)(&(avail->state[2])+1); 

i expression must modifiable lvalue error.

i same error when

&comp = (state1_t *)(&(heaalth->count) +1); 

how fix this? want address of comp @ end of 1 structure. how do that?

state1_t comp[8];

in declaration comp array of 8 struct's state1_t base address of array being comp cannot modifiable. hence modifiable lvalue error when try changing address of comp.


Comments

Popular posts from this blog

javascript - how to protect a flash video from refresh? -

visual studio 2010 - Connect to informix database windows form application -

android - Associate same looper with different threads -