in reply to Working with C structures over network

Be careful of alignment issues. Especially where you have non-byte members following single bytes within a struct. C compilers will often add padding to place WORD and DWORD members on 2 or 4 byte boundaries for efficiency reasons.

To quote K&R (page 130 in my copy).

But don't assume that the size of a struct is the sum of the size of it's members--because of alignment requirements for different objects, there may be "holes" in the structure.

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
  • Comment on Re: Working with C structures over network