![1523537786583293.png 1.png](https://s1.51ctocdn.cn//images/20180412/1523537786583293.png)
data type
#Essence
The essence of data type is memory address+data length
#Role
It is a model that can easily locate data and specify data size
#Representation
Basic Data Type
Custom Data Type
Use the typedef keyword to define typedef unsigned int UINT
Use the # define macro to define # define UINT unsigned int
Use struct/union to define structure
Defining constant values using enum
#Usage
[Attribute] Data type variable name;
auto int iVal;
Attributes can be omitted
There are three types of data type attributes
auto static register
#Auto attribute
Note: Auto in C and auto in C++have different meanings
In C language, it is an "attribute" of a variable
In the compiler, the default attribute of local variable data type is auto
Auto attribute default variable is allocated in stack space
In C11 standard, the auto attribute is obsolete
Global variables cannot use the auto attribute
//For example: # include
//At this time, the coded compilation will not pass
//Because auto default data is allocated in the stack space
//But our iVal is a global variable
//The global variable will be allocated in the global variable area, and the compiler will conflict
//Compilation will report a bad storage class error (VS2015 compiler) auto int iVal=0; int main(){ return 0;}
#Static attribute
……
#Register attribute
……
![1523538050477165.png 2.png](https://s1.51ctocdn.cn//images/20180412/1523538050477165.png)