32 keywords in C language and 32 keywords in C Language

Source: Internet
Author: User
Tags mail exchange

32 keywords in C language and 32 keywords in C Language

The C language contains 32 important and commonly used keywords, which are listed below:

32 keywords in C Language

Category 1: Data Type keywords

A basic data type (5)

Void

If the declared function has no return value or no parameter, it declares that there is no type pointer and the operation result is explicitly discarded.

Char

String type data is a type of integer data.

Int

Integer Data, usually the machine font specified by the compiler.

Float

Single-precision floating point data is a type of floating point data, which stores 6 digits after the decimal point.

Double

Double-precision floating-point data is a type of floating-point data, which is more precise than float, and stores 15/16 digits after the decimal point.

Type B modifier keywords (4)

Short

Modify int and short integer data. The modified int can be omitted.

Long

Modify int and long integer data. The modified int can be omitted.

Signed

Modify integer data. It is a signed data type.

Unsigned

The unsigned data type that modifies integer data.

C complex type keywords (5)

Struct

Struct declaration.

Union

Shared object declaration.

Enum

Enumeration declaration.

Typedef

Declared type alias.

Sizeof

Get the size of a specific type or a specific type of variable.

D storage-level keywords (6)

Auto

Automatically assigned and released by the compiler. Usually allocated on the stack.

Static

Static variables are specified and allocated in the static variable area. When modifying a function, the function scope is specified inside the file.

Register

It is recommended that the compiler store the variables in registers or modify the function parameters. It is recommended that the compiler PASS Parameters through registers instead of stacks.

Extern

Specify the corresponding variable as an external variable, which is defined in another target file. It can be considered as an agreement declared by another file.

Const

Used Together with volatile as the "cv feature", the specified variable cannot be changed by the current thread/process (but may be changed by the system or other threads/processes)

Volatile

In combination with const, the value of a specified variable may be changed by the system or other processes/threads, forcing the compiler to obtain the value of the variable from the memory each time.

Category 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 return value ).

Continue

End the current cycle and start the next cycle.

Break

Jump out of the current loop or switch structure.

Goto

An unconditional jump statement.

B branch structure (5)

If

Condition Statement.

Else

The Condition Statement denies the branch (used with if ).

Switch

Switch Statement (multi-branch Statement ).

Case

The branch flag in the switch statement.

Default

"Other" in the switch statement. Optional.

C Cycle Structure (3)

For

For loop structure, the execution sequence of for (1; 2; 3) 4; is 1-> 2-> 4-> 3-> 2... loop, where 2 is the cycle condition.

Do

Do Loop Structure, do 1 while (2); the execution order is 1-> 2-> 1... loop, 2 is the loop condition.

While

While loop structure, while (1) 2; execution order is 1-> 2-> 1... loop. 1 is a loop condition. If the expression of the loop condition is true, the loop continues. If the expression is false, the loop jumps out.

 

 

Author: xin, published in blog

Reprinted please indicate the source, welcome to mail exchange: zhuanxinxin@foxmail.com

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.