By default structures are padded in C. If you want to avoid this behaviour, you have to explicitly request it. Under GCC it's __attribute__((__packed__)). Consider this example on a 64-bit machine:
struct foo {
char *p; /* 8 bytes */
char c; /* 1 byte */
long x; /* 8 bytes */
...