"Excerpt notes" C language keywords

Source: Internet
Author: User

Data type keywords

Basic data Type (5)

void : Declares that a function has no return value or no parameter, declares an untyped pointer, and explicitly discards the result of the operation.

Char : character-type data

int : integral type data

float : single-precision floating-point data

Double: dual-precision floating-point data

Type modifier keywords (4)

short: Modifies int, shorter integer data, can omit the modified int.

Long: Modifies int, length shaping data, can omit the modified int.

signed : Modifies integer data, signed data type.

unsigned : Modifies integer data, unsigned data type.

Complex Type keywords (5)

struct : struct declaration

Union : Common Body Declaration

enum : enum declaration

typedef : declaring type aliases

sizeof : Getting the size of a particular type or variable of a particular type

Storage level Keywords (6)

Auto: Specified as an automatic variable, automatically allocated and freed by the compiler, usually allocated on the stack.

Static: Specified as a static variable, assigned in the static variable area, when the function is decorated, the specified function scope is inside the file.

Register : specified as a register variable, it is recommended that the compiler either store the variable in the Register or modify the function parameter, and suggest that the compiler pass the parameter through the register instead of the stack.

extern : Specifies that the corresponding variable is an external variable, which is defined in a different target file, which can be considered as a convention declared by another file.

Const : As with volatile, the "CV attribute", the specified variable cannot be changed by the current thread/process (but may be changed by the system or other thread/process).

volatile : With the const collectively referred to as "CV attribute", the value of the specified variable may be changed by the system or other process/thread, forcing the compiler to get the value of the variable from memory every time.

Process Control Keywords

Jump Structure (4)

return: Used in the body of the function to return a specific value (or void value, that is, no return value).

continue : Ends the current loop and starts the next cycle.

break: Jump out of the current loop or switch structure

goto : Unconditional Jump Statement

Branch structure (5)

if: Conditional statement-- ELSE: Conditional statement Negation branch (with IF)

Switch : Toggle statement (Multi-branch statement)--case: A branch tag in a switch statement-- default: The "other" partition in the switch statement is optional.

Cycle Structure (3)

FOR:FOR loop structure, for (1;2;3) 4; the execution order is 1->2->4->3->2 ... loop, where 2 is the loop condition.

DO:DO loop structure, do 1 while (2); The order of execution is 1->2->1 ... loop, 2 is the loop condition.

While:while loop structure, while (1) 2; The order of execution is 1->2->1 ... loop, 1 is the loop condition.

The above loop statement, when the loop condition expression is true to continue the loop, false then jump out of the loop.

"Excerpt notes" C language keywords

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.