Definition: The structure is a user-defined value type.
Code style:
Struct Pair
{
Public int X, Y; // uppercase letters of the public variable name (PascalCase Rules)
}
Struct Pair
{
Private int x, y; // The first letter of the first word of a non-public variable name (camelCase rule)
}
Struct Pair
{
Int x, y; // The default access modifier is private.
}; // There can be a semicolon
Note: The structure is the most common mechanism that C # programmers use to define their own value types. The structure is more powerful than enumeration because it provides functions, fields, constructors, operators, and access control. The default access permission of the structure member is private (public in C ++ ). When you define a structure member name, do not forget to use the PascalCase rule for public members, rather than the camelCase rule for non-public members.
Author: ershouyage