Name

LayoutKind

Synopsis

This enumeration is used to specify how objects are laid out when they are passed to unmanaged code. Auto specifies that .NET should choose the best method to lay out the objects. Explicit gives you complete control over how the object’s data members are laid out. You must use FieldOffsetAttribute with each member if you specify Explicit. Sequential lays out the object’s members one after the other, in the same order that they are defined in the class definition.

public enum LayoutKind {
   Sequential = 0,
   Explicit = 2,
   Auto = 3
}

Hierarchy

System.ObjectSystem.ValueTypeSystem.Enum(System.IComparable, System.IFormattable, System.IConvertible)LayoutKind

Returned By

StructLayoutAttribute.Value

Passed To

StructLayoutAttribute.StructLayoutAttribute()

Get C# in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.