What's the correct way to do pointer arithmetic in this example ?
Say I store a struct in a buffer at some offset and then want to get a pointer to it. e.g.
Is the pointerCode:int offset; sometype mystruct, *ptr; char buff; memcpy(buff[offset], mystruct, sizeof(mystruct));
ptr = (mystruct *)buffer[offset];
ptr = (mystruct *)buffer + offset;
ptr = (mystruct *)((&buffer) + offset);
or something else ? I'm getting confused - and coredumps ...