C

Asked • 03/19/19

Structure padding and packing?

Consider: struct mystruct_A { char a; int b; char c; } x; struct mystruct_B { int b; char a; } y;The sizes of the structures are 12 and 8 respectively.Are these structures padded or packed?When does padding or packing take place?

1 Expert Answer

By:

Tridip C. answered • 08/08/20

Tutor
4.9 (332)

5+ years of Experience in Programming in C/C++

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.