I have two structures as follows
typedef struct Rsp_s {
u8 code;
u8 Count;
}Rsp_t;
typedef struct Field_s {
u8 State;
u8 present;
u8 previous;
u8 event;
} Field_t
Then i have
Rsp_t *rsp;
Field_t data[3][7]
I want data[0][0] to follow rsp->Count.
How do i do that?
data = (Field_t *)(&(rsp->Count) +1);
does not do it.
aas a pointer to an int pointer&b[0][0] = aattempts to set the value of&b[0][0]to the value ofa. But&b[0][0]cannot be modified since it's fixed. Thus the error you see.a = &b[0][0];is legal it seems, but you'd certainly won't be able to dereference it with[][]((int**)a)[0][0] = 1;Not that it would likely be a useful thing to do, but this is C, you're allowed to shoot yourself in the foot.