Skip to content

Instantly share code, notes, and snippets.

@elleryq

elleryq/padding.c

Last active Aug 29, 2015
Embed
What would you like to do?
padding example (in 64-bit machine) which is from http://www.catb.org/esr/structure-packing/
// You wrote:
struct foo1 {
char *p;
char c;
long x;
};
// Actually:
struct foo1 {
char *p; /* 8 bytes */
char c; /* 1 byte */
char pad[7]; /* 7 bytes */
long x; /* 8 bytes */
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.