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.
In reply to Re: Working with C structures over network
by BrowserUk
in thread Working with C structures over network
by carcassonne
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |