fixing packing of structs to be written to files
What is the correct packing to build a struct to write it to a file, (a TGA header right now). its unopenable right now, and I''m almost positive its the packing.
#pragma pack(push, 1)
...
#pragma pack(pop)
doesn''t work, am I doing it wrong? it doesn''t appear wrong according to MSDN, its the 1 i''m not sure about. i searched for TGA readers/writers, they all just write each part one by one. I don''t really mind doing it that way, i''d just like to know why my packing code doesn''t work. thanks for the help
i''m doing it like this:
#pragma pack(1)
...
#pragma pack()
alternatively, you can do it like this (i think...)
#pragma pack(1)
...
#pragma pop()
#pragma pack(1)
...
#pragma pack()
alternatively, you can do it like this (i think...)
#pragma pack(1)
...
#pragma pop()
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement