The differences between variable declaration and variable definition in c ++. December 6, 2016, variable. 2016
Entire Process:
1. The program tells the cpu that the program will use a variable. (This is not required for the time being. Let's talk about it first .)
2. The program tells the CPU that the program will use a variable now. (Use now)
3. The cpu divides the memory into several units (bytes) based on the type of this variable. This space is used to store the variables required by the program.
4. The CPU fills the specific data represented by this variable into the corresponding memory space according to the Data Type of this variable.
------------
Variable Declaration
Now we know two types: int a; extern;
Int;
Must include 1.; may include 2.3.4. [4. The CPU may use a NULL value to replace the specific data value, and fill in the real data value later .];
Extern;
It must contain only 1; it must not contain 2.3.4 .;
Variable definition
Must include 1.2.3.4 .;
Record Date: December 6, 2016 11:25:10