Original Post
Hi, I've got a problem with a current project I was wondering if anyone could shed some light on. I start be reading in a file, the format for this is already set, It's not something I have the option of hanging. The file loads into a buffer with no issues. Since the buffer I load it in to is jsut a void* I want to cast it so I can pull the data out. I have a pointer of the correct type, I set it to the start of the buffer. No problems so far. When I tried getting the data out of the structure I noticed the 3 item in the structure and everything after it was wrong. The start of the structure lay at 0x......40 in memory (exact address isn't importent). The contents was layed out like this: DWORD (0x......40) WORD (0x......44) - Correct WORD[2] (0x......46 & 0x......48) - Correct DWORD (0x......4c) - Wrong, it should be at 0x......4a If one of the WORDs above the last DWORD is removed then it sits at 0x......48 as you'd expect, it just doesn't like sitting 10Bytes ahead of the start of the structure where I need it. To me it looks like the last DWORD is being forced onto a 4Byte boundry, but why? It's not something I've done and the WORD above isn't so it doesn't look like a global setting. Anyone know what's going on?