The use of pragma pack is to ensure that the data structure is byte-aligned versus word-aligned. For example, the following struct takes up 8 bytes (perhaps not on all systems), but on typical Linux machines:
Code:
struct Foo
{
int val; /* takes up 4 bytes */
char ch; /* takes up 1 byte */
};
/* Yet struct Foo takes up 8 bytes */
With the pragma pack directive, the struct above will only take up 5-bytes.