***32 C language keywords defined by the ANSI standard:
auto double int struct break else long switch
case enum register typedef char extern return union
const float short unsigned continue for signed void
default goto sizeof volatile do if while static
Keywords can be divided into There are two categories: data type keywords and process control keywords.
1 Data type keyword
A basic data type (5)
void: declares a function with no return value or no parameters, declares an untyped pointer, Explicitly discard the operation result
char: character type data, a type of integer data
int: integer data, usually the machine word length specified by the compiler
p>
float: single-precision floating-point data, a type of floating-point data
double: double-precision floating-point data, a type of floating-point data
B type modification keywords (4)
short: Modifies int, short integer data, the modified int can be omitted.
long: modified int, long integer data, the modified int can be omitted.
signed: modified integer data, signed data type
unsigned: modified integer data, unsigned data type
C complex type keyword (5 )
struct: structure declaration
union: ***User declaration
enum: enumeration declaration
typedef: Declare type alias
sizeof: Get the size of a specific type or variable of a specific type
D storage level keyword (6)
auto: Specify as an automatic variable , automatically allocated and released by the compiler. Usually allocated on the stack
static: designated as a static variable, allocated in the static variable area. When modifying a function, specify the function scope to be inside the file
register: designated as a register variable, It is recommended that the compiler stores variables in registers for use, and can also modify function parameters. It is recommended that the compiler transfer parameters through registers instead of stacks
extern: Specify the corresponding variables as external variables, that is, in another target file Defined in, it can be considered as an agreement declared by another file. Const: Together with volatile, it is called "cv characteristic". The specified variable cannot be changed by the current thread/process (but may be changed by the system or other threads/processes)
volatile: Together with const, it is called the "cv feature". The value of the specified variable may be changed by the system or other processes/threads, forcing the compiler to Get the value of the variable from memory
2 Process control keywords
A jump structure (4)
return: used in the function body, Return a specific value (or a void value, that is, no value is returned)
continue: end the current loop and start the next cycle
break: jump out of the current loop or switch structure
goto: unconditional jump statement
B branch structure (5)
if: conditional statement
else: conditional statement negates the branch (with if used together)
switch: switch statement (multiple branch statements)
case: branch mark in the switch statement
default: "other" in the switch statement Divide and conquer, optional.
C loop structure (3)
for: for loop structure, the execution order of for(1;2;3)4; is 1->2->4-> 3->2... loop, where 2 is the loop condition
do: do loop structure, the execution order of do 1 while(2); is 1->2->1... loop, 2 is the loop condition
while: while loop structure, the execution sequence of while(1) 2; is 1->2->1... loop, 1 is the loop condition
In the above loop statement, when the loop conditional expression is true, the loop will continue, and if it is false, it will jump out of the loop.