#What are the keywords in C language?
There are 32 keywords in C language. According to the function of keywords, they can be divided into four categories: data type keywords, control statement keywords, storage type keywords and other keywords.
1. Data type keywords (12):
(1) char: declare character variable or function
(2) double : Declaring a double precision variable or function
(3) enum : Declaring an enumeration type
(4) float : Declaring a floating point variable or function
(5) int : Declaring an integer variable or function
(6) long : Declaring a long integer variable or function
(7) short : Declaring a short integer variable or function
( 8) signed: declare a signed type variable or function
(9) struct: declare a structure variable or function
(10) union: declare a union (union) data type
(11) unsigned: declare an unsigned type variable or function
(12) void: declare a function with no return value or parameters, declare an untyped pointer (basically these three functions)
2. Control statement keywords (12):
A. Loop statement
(1) for: a loop statement
(2) do: The loop body of the loop statement
(3) while: The loop condition of the loop statement
(4) break: Jump out of the current loop
(5 ) continue: end the current loop and start the next cycle
B. Conditional statement
(1) if: conditional statement
(2) else: conditional statement negates the branch (Used with if)
(3) goto: unconditional jump statement
C. Switch statement
(1) switch: used for switch statement
(2) case: switch statement branch
(3)default: "other" branch in the switch statement
D. Return statement
return: subroutine return statement (Can take parameters or not)
3. Storage type keywords (4)
(1)auto: declare automatic variables Generally not used
(2)extern: The declared variable is declared in other files (can also be regarded as a reference variable)
(3)register: Declared register variable
(4)static: declare static variables
4. Other keywords (4):
(1)const: declare read-only variables
(2)sizeof: Calculate the length of the data type
(3)typedef: Used to alias the data type (of course there are other functions
(4)volatile: Description Variables can be changed implicitly during program execution.
For more tutorials, please follow php中文网.
The above is the detailed content of What are the keywords of C language?. For more information, please follow other related articles on the PHP Chinese website!