you may find that the file stays unchanged. This is an aliasing error and it happens because the compiler attempts to optimize memory accesses as much as possible, and doesn't realize that myData and header point to overlapping regions.
> unsigned int offset = 123;
> _POOL_HEADER* myStruct= &myData[offset];
Watch out for accessing multi-byte data types such as short on an odd address. Most machines prefer (or require) that objects that are N bytes wide are stored at addresses that are even with respect to N (addr % N == 0).
its possible but not really friendly.
its easier for your scenario to just say
mystruct* msp = new mystruct[somesize];
…
msp[x].field = whatever;
etc;
…
char* cp = (char*)msp;
file.write(cp, somesize*sizeof(mystruct)); //or whatever you needed the char* for
and of course you can just cast in place for the file write / network write / whatever you were doing.