Skip to content

Latest commit

 

History

History
23 lines (15 loc) · 514 Bytes

File metadata and controls

23 lines (15 loc) · 514 Bytes

Structs

Composite types are user-defined data layouts. They consist of fields that can be either primitive types or other composite types.

struct Point
{
    public int X;
    public int Y;
}
  • Layout:

    Fields are laid out in memory in the order of their declaration

  • Size:

    The size of a struct is the sum of the sizes of its fields plus any necessary padding for alignment

  • Value Semantics:

    By default, struct's are passed by copy unless a any reference is used