The only code that is working properly is:Originally posted by Polymorphic OOP
yup, my mistake, sorry about that. It's too late at night here, heh
unsigned char* thru_ptr;
thru_ptr = map[PartIndex]+1;
Why were you adding 4!? that would put you four pointers ahead, not 1 pointer ahead. Pointer arithmetic goes by the size of the type being pointed to. Using + 1 will move you sizeof( unsigned char* ) bytes ahead, which will usually be 4 bytes. If you add 4 like your example, you'd actually be adding 4 * sizeof( unsigned char* ) bytes, whihc would usually be 16 bytes.
unsigned char* thru_ptr;
* (int *) thru_ptr = (int)(map[PartIndex]+4 );
I am adding 4 because thru_ptr is defined as char, at least I think so and it works ;-)