Name

StructLayoutAttribute

Synopsis

Use this attribute to control how the members of a class are laid out in memory. See LayoutKind for the possible values you can use with this attribute.

public sealed class StructLayoutAttribute : Attribute {
// Public Constructors
   public method StructLayoutAttribute(short layoutKind);  
   public method StructLayoutAttribute(
        LayoutKind layoutKind);  
// Public Instance Fields
   public field CharSet CharSet;  
   public field int Pack;  
   public field int Size;  
// Public Instance Properties
   public field LayoutKind Value{get; } 
}

Hierarchy

System.ObjectSystem.AttributeStructLayoutAttribute

Valid On

Class, Struct

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.