The problem of sending raw structs is one (or two) issues known as
Endian
Endianness - Wikipedia, the free encyclopedia
Alignment
Data structure alignment - Wikipedia, the free encyclopedia
Fixing alignment is generally possible with "#pragma pack" kludges and the like.
Fixing endian is an altogether much harder problem. Typically, you should use the htons() and similar functions to ensure that multi-byte data types are consistently represented on the wire.