First, enumerate
Enum Keyword: enum
Enum Sex
{
Man
Woman
}
Enum Cnumber
{
0 = 0,
one = 1,
Ii. = 2,
}
Second, the structural body
Structure of the keyword struck
Structure definition:
Struck Struckname
{
Public data type variable name;// in a struct declaration, it cannot be initialized unless the field is declared const or static.
public void function name () {};
Public Struckname (parameter) {}// struct cannot declare a default constructor (a constructor without parameters) or a destructor , but can declare a constructor with parameters
}
Declaration instantiation:
Struckname STK = new Struckname ();//The instantiation of a struct may not use the new operator, so struckname Stk;
Third, class
class's keyword class
Definition of Class
Class MyClass
{
MyClass ()
{
destructor body.
}
}
Declaration instantiation:
MyClass MyClass = new MyClass ();
C # enumerations, structs, classes