A struct-declaration is a type-declaration that declares a new struct:
struct-declaration:
attributesopt struct-modifiersopt partialopt struct identifier type-parameter-listopt
struct-interfacesopt type-parameter-constraints-clausesopt struct-body ;opt
A struct-declaration consists of an optional set of attributes , followed by an optional set of struct-modifiers , followed by an optional partial modifier, followed by the keyword struct and an identifier that names the struct, followed by an optional type-parameter-list specification , followed by an optional struct-interfaces specification ), followed by an optional type-parameters-constraints-clauses specification , followed by a struct-body , optionally followed by a semicolon.
A struct-declaration may optionally include a sequence of struct modifiers:
struct-modifiers:
struct-modifier
struct-modifiers struct-modifier
struct-modifier:
new
public
protected
internal
private
It is a compile-time error for the same modifier to appear multiple times in a struct declaration.
The modifiers of a struct declaration have the same meaning as those of a class declaration .
The partial modifier indicates that this struct-declaration is a partial type declaration. Multiple partial struct declarations with the same name within an enclosing namespace or type declaration combine to form one struct declaration, following the rules specified in §10.2.
A struct declaration may include a struct-interfaces specification, in which case the struct is said to implement the given interface types.
struct-interfaces:
: interface-type-list
Interface implementations are discussed further in §13.4.
The struct-body of a struct defines the members of the struct.
struct-body:
{ struct-member-declarationsopt }