Home >Backend Development >C#.Net Tutorial >What types of keywords are there in C language?

What types of keywords are there in C language?

尚
Original
2020-03-02 10:03:5815301browse

What types of keywords are there in C language?

#There are 32 keywords in C language. According to the function of keywords, they can be divided into data type keywords, control statement keywords, storage type keywords and others. Four categories of keywords.

Data type keywords (12):

(1) char: declare character variable or function

(2) double: declare double precision variable Or function

(3) enum: declare enumeration type

(4) float: declare floating point variable or function

(5) int: declare integer variable Or function

(6) long: declare a long integer variable or function

(7) short: declare a short integer variable or function

(8) signed: declare Signed type variables or functions

(9) struct: declare structure variables or functions

(10) union: declare 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)

Control Statement keywords (12):

A loop statement

(1) for: a loop statement (can be understood but not expressed)

(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, Start the next round of loop

B conditional statement

(1)if: conditional statement

(2)else: conditional statement negation branch (used in conjunction with if)

(3)goto: unconditional jump statement

C switch statement

(1)switch: used for switch statement

(2)case: switch statement branch

(3)default: the "other" branch in the switch statement D return statement return: subroutine return statement (can take parameters or not)

Storage type keyword ( 4)

(1)auto: It is generally not used to declare automatic variables

(2)extern: The declared variable is declared in other files (can also be regarded as a reference variable)

(3)register: declare accumulator variables (4)static: declare static variables

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 related tutorials, please pay attention toPHP Chinese website!

The above is the detailed content of What types of keywords are there in C language?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn