Re: Need help with RPI-Engine
Actually Camlorn, the pointer rules are pretty strict on that one: x will always point at a[4] (pointer addition uses structure sizes.)
Did you mean instead:
char *y = (char *)a
y = y+4
int *x = (int *)y
That could put you in the middle of an integer on a 64 bit machine, and dereferencing x could give you an alignment exception depending on architecture type.
Regardless, I think your original point is made even more clear by this: pointers in C can be complicated and are poorly understood, often leading to catastrophic yet unobvious mistakes.
-dentin
Alter Aeon MUD
|