C # From getting started to giving up treatment 1: Exploring C # World,
C # is an advanced object-oriented language that runs on. NET framework. Its language specifications and syntax are surprisingly similar to those of java. So if you have a java foundation before learning C #, you will get started quickly. Of course, even if you do not have the java Foundation, it will not be in the way. In subsequent studies, you will soon be exposed to the features of C # language-object-oriented.
In the next article, I will take you into the C # language quickly.
1: to do well, you must first sharpen your tools.
We have to develop Visual studio as a tool. Here we have to select version 2015. Of course, you can also choose a later version. This has no impact. I just changed the location of some plug-ins or functions.
Https://www.ithome.com/html/win10/164028.htm
For personal learning, the Community version is sufficient for our daily development. It only caws some features, but for our student party. This is okay...
2: My first C # project
There are two options
The first is the form application .. We are commonly known as the Drag Control ". You just need to upload the desired dashboard to the initialized ui, and then write code to the corresponding control.
The second one is the one I want to discuss today. Console program.
This is the same as the C language. It is displayed through the window command line. Any of your results can be displayed above.
We also follow the consistent development principles in the programming field .. The Main method is used as the entry.
3: basic syntax:
Output statement
Console.WriteLine("Length: {0}", length);
Line feed output. This statement is the output Length and line feed. The effect is the same as that of printf ("length % d \ n", Length) in C. Similarly, the result of Console. Write is to output a statement without line breaks.
Input statement
Console.ReadLine();
This refers to reading a piece of data. Then we can play this game...
The output result is
The second test statement is input. This is the basic input and output.
4: Basic Data Type
The Type derived from System. ValueType.
Type |
Description |
Range |
Default Value |
Bool |
Boolean Value |
True or False |
False |
Byte |
8-bit unsigned integer |
0 to 255 |
0 |
Char |
16-bit Unicode characters |
U + 0000 to U + ffff |
'\ 0' |
Decimal |
Exact decimal value of 128 bits, 28-29 effective digits |
(-7.9x1028 to 7.9x1028)/100 to 28 |
0.0 M |
Double |
64-bit dual-precision floating point |
(+/-) 5.0x10-324 to (+/-) 1.7x10308 |
0.0D |
Float |
32-Bit Single-precision floating point |
-3.4x1038 to + 3.4x1038 |
0.0F |
Int |
32-bit signed integer type |
-2,147,483,648 to 2,147,483,647 |
0 |
Long |
64-bit signed integer type |
-923,372,036,854,775,808 to 9,223,372,036,854,775,807 |
0L |
Sbyte |
8-bit signed integer type |
-128 to 127 |
0 |
Short |
16-bit signed integer type |
-32,768 to 32,767 |
0 |
Uint |
32-bit unsigned integer type |
0 to 4,294,967,295 |
0 |
Ulong |
64-bit unsigned integer type |
0 to 18,446,744,073,709,551,615 |
0 |
Ushort |
16-bit unsigned integer type |
0 to 65,535 |
0 |
Of course, it is certainly impossible to use it all in future development. These are for reference only or for exams .. Haha.
Updating ........................