Advertisement

byte alignment with VC

Started by April 03, 2005 08:58 AM
12 comments, last by traiger 19 years, 4 months ago
Thanks for continued patience

Does the gcc example automatically pack to 1 byte?

Plus is the gcc platform indepentant, could I use it with VC?
Quote: Original post by traiger
thanks

alittle confused as to how to use that though.

#include <PshPack1.h>

void ReadFile(char *filename)
{

...

}

#include <PopPack.h>

Can't be right perhaps you could provide an example.


#include <PshPack1.h>
struct TGAHeader
{
unsigned char ...
...
...
};
#include <PopPack.h>

and as a side note, this does the same thing as what CustardSlice suggested, the headers just take care of the pushing and popping so you only have to think about which alignment you want.
Advertisement
cool thanks all
Guess what...

I need to do this again but in Linux using gcc.

should the PshPack and PopPack headers be available because I cant find them?

thanks

Traiger

This topic is closed to new replies.

Advertisement