From: Clifford Heath Date: 2003-09-12T09:55:36+09:00 Subject: Re: Nested struct alignment summarized I solved the same problem for my C++ DDT (Dynamic Data Typing) library. The difficulty is that the same compiler may have many different sets of structure alignment rules. For example, with the Microsoft compilers, you can use "#pragma pack(N)" to tell the compiler to apply different minimum alignment for any struct. The Windows APIs *actually use* this pragma, so any code to mimic the memory layout must have not only a list of the field types, but also of the rules being used. A nested structure might even have different alignment rules than the structure inside which it's nested, and all this is platform dependent. Unless you're prepared to wear limiting yourself to a single chosen set of alignment rules, or to provide possibly many platform-specific hints in your metadata (I did both, chosen default with optional annotations), you're SOL. Clifford.