Quote:Original post by CodeCriminalI assume it's
One question though, which pragma directive are you refering to?
#pragma pack(1)class Vector3 {public: ...(lots of member functions)... float i; float j; float k;};#pragma pack()
or the push/pop variants. Unfortunately, #pragmas are compiler dependent. The above is known from M$ compilers.The way GCC suggests is different; something like
class Vector3 {public: ...(lots of member functions)... float i; float j; float k;} __attribute__((packed));
for packing the entire structure. However, at least older versions of GCC supported the #pragma way for compatibility reasons as well.