9 Control statements in the second and C languages
Goto statement: Unconditional turn;
If statement: Judgment statement;
While loop statement;
Do-while statement: The loop body is executed first and then the loop condition is determined. then continue the cycle;
For statement: The loop, which can replace the while statement, but the usage is different;
Break statement jumps out of the loop of this layer (only the loop that contains this statement)
Continue statement: Continue (generally put in the loop statement, not in the execution of the statement below it, jump directly to the judgment Statement Example: For statement, jump directly to the second semicolon, while statement, jump directly to the while () in parentheses;
Switch statement: multi-phase selection;
Return statement: returns;
1 Data type Keywords
A basic data type (5)
void: Declares a function with no return value or no argument, declares an untyped pointer, and explicitly discards the result of the operation
Char: Character type data, which is an integral type of data
int: integer data, usually the machine word length specified by the compiler
FLOAT: single-precision floating-point data, a type of floating-point data
Double: dual-precision floating-point data, which is a type of floating-point data
Type B modifier keywords (4)
Short: Modifies int, shorter integer data, can omit the modified int.
Long: Modifies int, length shaping data, can omit the modified int.
Signed: Modifying integer data, signed data type
Unsigned: Modifying integer data, unsigned data type
C Complex Type keywords (5)
struct: struct declaration
Union: Common Body Declaration
Enum: enum declaration
typedef: Declaring type aliases
sizeof: Getting the size of a particular type or variable of a particular type
D Storage-level keywords (6)
Auto: Specified as an automatic variable, automatically allocated and freed by the compiler. Usually allocated on the stack
Static: Specifies that the function is scoped to the file when it is assigned the static variable, and when the function is modified
Register: Specified as a register variable, it is recommended that the compiler either store the variable in the Register or modify the function parameter, suggesting that the compiler pass the parameter through the register instead of the stack
extern: Specifies that the corresponding variable is an external variable, defined in another target file, and can be considered a "reference" to an object declared by another file.
Const: With volatile collectively "CV attribute", specified variable cannot be changed by current thread/process (but may be changed by system or other thread/process)
Volatile: With the const collectively referred to as "CV attribute", the value of the specified variable may be changed by the system or other process/thread, forcing the compiler to get the value of the variable from memory every time
2 Process Control Keywords
A jump Structure (4)
Return: Used in the body of a function to return a specific value (or void value, i.e. no return value)
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 Negation branch (with IF)
Switch: Toggle statement (Multi-branch statement)
Case: Branch marks in a switch statement
Default: The "other" partition in the switch statement is optional.
C cycle Structure (3)
FOR:FOR loop structure, for (1;2;3) 4, order of execution for 1->2->4->3->2 ... loop, where 2 is a loop condition
DO:DO loop structure, do 1 while (2); The order of execution is 1->2->1 ... loop, 2 is the loop condition
While:while loop structure, while (1) 2; The order of execution is 1->2->1 ... loop, 1 is the loop condition
The above loop statement, when the loop condition expression is true to continue the loop, false then jump out of the loop
C Language 32 keywords (2)