Home > Backend Development > C#.Net Tutorial > What are the keywords of C language?

What are the keywords of C language?

angryTom
Release: 2020-02-08 09:24:15
Original
30384 people have browsed it

What are the keywords of C language?

#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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template