Eric Raymond has a lovely essay here: http://www.catb.org/esr/structure-packing/ [catb.org] that describes some non-intuitive behavior in how compilers assemble structures in memory. The default is to pad structures out with empty bytes to align data types around arbitrary byte boundaries for similarly non-intuitive reasons.
If you don't immediately understand why this struct is 12 or 16 bytes long, it's worth reading.
struct Foo {
char *p; /* 4 or 8 bytes */
char c; /* 1 byte */
int x; /* 4 bytes */
}