c#c# definition:
C # is an object-oriented, component-oriented language that is part of. Net.
Program Structure:
Name space
Class
Property
Method
Main function entry
}
Data type:
C # Data types are divided into: value type (value types), reference type (Reference types), pointer type (Pointer types)
value types : Store them and content on the stack
Boolean value: BOOL,
Characters: Char,
Decimal: Float, double, decimal
Signed integers: sbyte, short, int, long
Unsigned number: Byte, uint, ULONG
Infrequently used: Ensum (enum), struct (struct)
The detailed scope of each data type is as follows:
reference Types : Store objects in the heap, store references in different places, mainly related to objects, etc.
class -related objects, such as object,string (string is an alias of string), and class
Interface: interface
Arrays: such as: int[]
Commissioned by: Delegate
pointer type :
Pointers in C # have the same functionality as pointers in C or C + +. such as: int* P;
Common knowledge:
Escape characters :
Mathematical operators :
Subtraction: + 、-、 *,/(Division sign will calculate the result with the most accurate parameters, if all integers, the fractional part will be shed, such as: 3/2.0 = 1.5,3/2 = 1)
exponentiation: ^
Self-increment/decrement: + + 、--
Modulus:%
All operators and precedence are as follows:
Basic Statement :
Statement: int/char/string name;
Judgment: If
Loops: While, for, do while, foreach
Select: Switch
Jump Out (less)/interrupt/Loop Skip: Goto, break, continue
Function:
Two key words
Static
Acting on variables: allocating memory at compile time, releasing at end of program
Function: This function is only visible within this file
void: No type, used when the function does not require arguments or return values
Static <returnType><FunctionName><paramType> <paramName>,...)
{
Logic
Return <returnValue>;
}
C # language Summary 1