|
From: James W. W. <ja...@wr...> - 2004-12-17 20:09:01
|
Roger Holmes <rog...@mi...> wrote: >One way might be: > >myStruct * myStructPtr; > >myStructPtr = ( myStruct*) ( (int) myStructPtr + sizeOfMyStruct ) ; Better to say myStructPtr = ( myStruct*) ( (char*) myStructPtr + sizeOfMyStruct ) ; There is no guarantee that the int type has the same size as a pointer type. (Indeed, on the old 68K platform with CodeWarrior, int was 2 bytes.) -- James W. Walker, ScriptPerfection Enterprises, Inc. <http://www.write-brain.com/> |