Infosys Interview Question

How to pack a structure?

Interview Answer

Anonymous

Mar 3, 2021

We can pack any structure using __attribute__((__packed__)) in gcc. Example - typdef struct A __attribute __((__packed__)) { char c; int i; }B;