Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardC#struct memory layoutSingle-choice MCQ

A struct contains a `bool` field followed by an `int` field. You mark it `[StructLayout(LayoutKind.Sequential, Pack = 1)]`. What changes compared to the default sequential layout?

[StructLayout(LayoutKind.Sequential, Pack = 1)] struct S { bool flag; int value; }