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

FieldOffsetAttribute

Synopsis

This attribute controls the offset, in bytes, of a field. Use it to match your .NET types to the layout of C and C++ structures exactly. This attribute can be used only within classes that have the StructLayoutAttribute attribute where LayoutKind.Explicit was used.

public sealed class FieldOffsetAttribute : Attribute {
// Public Constructors
   public method FieldOffsetAttribute(int offset);  
// Public Instance Properties
   public field int Value{get; } 
}

Hierarchy

System.ObjectSystem.AttributeFieldOffsetAttribute

Valid On

Field

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