0. Static modifier variables and functions
static modifier variable, 1) scoped, in this file. Global variables (custom, this file before the need for extern declaration), local variables function, 2) life cycle, the program has been saved during operation.
static modifier function, scoped, in this file.
1. The enum type variable size is 4 (sizeof), regardless of the number of enum members.
2. The enum member is split with ",", and the last member can be separated without a separator number.
The struct and union members are split with ";", and the last member is separated by a separator number. The members of the struct are initialized with the "," split, and the last member is added without "," can be.
3. Stu_pst is a type of struct student for TypeDef, const STU_PST STU3 and Stu_pst const STU4 are completely equivalent. Data types can be ignored.
4. {} used is packaging.
5. A const-Modified read-only variable cannot be used as a dimension to define an array, nor can it be placed after the case keyword.
6. P is the struct student type of TypeDef, P+0X1 is &p + sizeof (struct student).
7. In the C language, all data arguments that are not in the array form are called in the form of a pass-through value. (Make a copy of the argument and pass it to the called function, the function cannot modify the value of the actual variable that is the argument, but only the copy that is passed to it)
In C, when a one-dimensional array is used as a function parameter, the compiler always parses it into a pointer to the first address of its first element.
8. Memory can be divided into three zones: static zone, Stack, heap
Static zones: Saves automatic global variables and static variables (including static global and local variables). The contents of the static zone are present throughout the lifetime of the program and are allocated by the compiler at compile time.
Stack: saves local variables. The contents of the stack exist only within the scope of the function and are automatically destroyed when the function is finished. It is characterized by high efficiency, but limited space size.
Heap: Memory allocated by the MALLOC series function or the new operator. Its life cycle is determined by free or delete. persists until the program ends without releasing it. It is characterized by the use of flexible, space is relatively large, but error-prone.
9. The pointer must be initialized to NULL in order to be judged by the IF (NULL! = p).
Deep analysis of C language learning error point record