There are two ways of solving the problem: ● Use #pragma pack directive. This is an easy way to remove the problem with the drawback that each access to an unaligned element in the structure will use more code. ● Write your own customized functions for packing and unpacking structures. This is a more portable way and there will not be any more code produced apart for your functions. The drawback is the need for two views on the structure data—packed and unpacked.