O'Reilly logo

C# in a Nutshell by Peter Drayton, Ted Neward, Ben Albahari

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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()

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required