There are a total of 32 C language keywords defined by the ANSI standard. According to the function of the keywords, the keywords can be divided into two categories: data type keywords and process control keywords.
1. Data type keywords
A Basic data types (5)
void: Declaring that the function has no return Value or no parameters, declare an untyped pointer, display the discard destination result
char: character type data, a type of integer data
int: integer data, usually the compiler Specified machine word length
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: Modifies int , long integer data, the modified int can be omitted
signed: modified integer data, signed data type
unsigned: modified integer data, unsigned data type
Related recommendations: "php video tutorial"
C complex type keywords (5)
struct: structure declaration
union: union declaration
enum: enumeration declaration
typedef: declare type alias
sizeof: get the size of a specific type or a specific type or variable
D Storage level keywords (6)
#auto: Specify automatic, 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 the function, specify the scope of the function pointer to be inside the file
register: designated as a register variable, recommended The compiler stores variables in registers for use, and can also modify function parameters. It is recommended that the compiler passes parameters through registers instead of stacks
extern: Specify the corresponding variables as external variables, that is, defined in another target file , can be considered as a convention for variables declared in another file
const: together with volatile are called "CV characteristics". 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 "CV feature". The value of the specified variable can be changed by the system or other threads/processes, forcing the compiler to obtain the value of the variable from memory each time
2. Process control keywords
A jump structure (4)
return: used in the function body to return a specific Value (or 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 (used together with if )
switch: switch statement (multiple branch statements)
case: branch mark in the switch statement
default: "other" divide and conquer in the switch statement, 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, while(1)2; execution sequence 1->2->1..., 1 is the loop For the above conditional loop statement, when the loop conditional expression is true, it will continue, and if it is false, it will jump out of the loop.
The above is the detailed content of Detailed explanation of 32 keywords in C language. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 English version
Recommended: Win version, supports code prompts!

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SublimeText3 Mac version
God-level code editing software (SublimeText3)

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Atom editor mac version download
The most popular open source editor