Enum enum
How to use:
Enum <typename>: <underlyingtype>
{
value1 = <actualval1>
value2 = <actualval2>
......,
Valuen = <actualvaln>
}
Example
Enum Orientation:byte
{
North = 1,
south=2,
East=3,
West=4
}
struct structure
How to use:
struct <typename>
{
<menberdeclarations>;
}
Forms of Menberdeclarations:<accessibility> <type> <name>
Example
struct route
{
Public orientation Declaration of data members for derection;//structures
The keyword public lets the code that invokes the struct have access to the data member
public double distance;
}//Defining structures
Array
<basetype>[] Declaration of the <name>;//array
Initializing an array with new
<basetype>[] <name> = new <typename>[n];//new explicitly initializes the array with a constant value of N to define the size. This method assigns the same default value to all elements (the numeric type is 0). You can also initialize with a very bright variable.
C # enumeration, structure, array of learning notes