Study Notes (08): C # fast entry - the concept of variable declarations and assignments

Learning immediately: https://edu.csdn.net/course/play/20589/257716?utm_source=blogtoedu

_______________________________________________________________________________________________________

Life is mediocre, short on the long race, but not road several ups and downs, gains and losses memorable.

_______________________________________________________________________________________________________

 

Variables: computer data storage memory

It may be assimilated into the open room when open room with the number of personnel as well as a different gender, we opened the hotel room is not the same.

We store data size, different types, when we opened the room type in the computer is not the same computer.

 

Declare variables that apply to the system memory

Declare variables need to specify the type and name of the variable, the following syntax [variable type] [variable name]

Variable type you want to be understood as a kind of room names can be understood as the room number

 

 Variable name = value; // assign to this variable = number indicates the assignment of meaning in this line of code, represents the value of the right-hand side, the left side of the equal sign is assigned to the variable.

int number; // represents an integer type opened up room in memory, and we named number number = 50; // 50 said it would put this number in the integer

 

 

Variable type variable name = value; // declare a variable, and to assign

1> use of the process variables: the assignment must first be declared in the final

2> variable does not allow duplicate declarations or definitions. But it may be repeated assignment

 int age;

            age = 18;

            string name;
            name = "wudoumi";
            Console.WriteLine(name);
            Console.WriteLine(age);
            Console.ReadKey();

 

 

Released eight original articles · won praise 0 · Views 64

Guess you like

Origin blog.csdn.net/weixin_44944420/article/details/105284948