Today I learned some of the language basics of C #.
Mainly include: input, output.
One, input console.readline (); Input statement
Output Console.Write (); Output statement
Console.WriteLine (); Output Statement Wrap Line
Comments
Ctrl+k then press C, comment on the selected section
Ctrl+k then press U to uncomment
Second, data conversion
① value type:
Shaping: Int (Int32), Long (Int64), float: float (single);d ouble (double);d ecimal (decimal);
Character type: char (char), Boolean: bool (Boolean), DateTime: Date, enum type: enum;
Structure type: struct;
② reference types
String Type: Strings (String)
③ Constants and variables (cannot be assigned, only values, const)
④ Basic Type conversions
- Auto-Convert (implicit conversion): value type → reference type (added later.) Tostring)
- Cast (explicit conversion): decimal-to-integer && reference-to-value class (1. With (), 2. With convert 3. Using the parse [common])
Hq-day2 C # language Basics