(reposted from Lite-C forum as this seems more appropriate)
I have this struct:
typedef struct { int x, y; float hello; } Foo ;
Foo* asFoo(ENTITY* e) {
Foo* r = (Foo*)(&e->skill[70]);
return r;
}
This is being used to map the block of memory occupied by skill[0..99] over the Foo structure.
Oddly, this function works sometimes and others it returns NULL!?!?
Seems to be a weird casting issue with the skill array.
Can anyone tell me why this happens?