Skip to content

Latest commit

 

History

History
14 lines (10 loc) · 294 Bytes

File metadata and controls

14 lines (10 loc) · 294 Bytes

Struct Packing

Back{: .button}

struct __attribute__((__packed__)) foo {
    char *p;  /* 8 bytes */
    char c;   /* 1 byte  */
    long x;   /* 8 bytes */
};

Structs can be packed without data alignment by using the __attribute__ __packed