Mukesh Chauhan

Just another WordPress.com weblog

Disable structure padding in C


Following is the way to disable structure padding using pragma in C.

#pragma pack(push, 1)
//Define your structure here
#pragma pack(pop)
//Structure padding is re enabled.

More information can be found at MSDN. GCC follows the same specifications.

July 1, 2011 - Posted by | Uncategorized

No comments yet.

Leave a comment