当前位置:网站首页>[C language] 32 keyword memory skills

[C language] 32 keyword memory skills

2022-06-25 15:02:00 52Hertz. six hundred and fifty

The first category : Data type key

A Basic data type (5 individual )

  1. void: Declare that the function has no return value or parameter , Declare no type pointer , Explicitly discard the result of the operation .
  2. char: Character data type
  3. int: Integer data type
  4. float: Single precision floating point data ( A type of floating-point data , After the decimal point 6 position )
  5. double: Double precision floating point data ( A type of floating-point data , Than float High precision of type , After the decimal point 15/16 position )

B Type modifier keyword (4 individual )

  1. short: modification int, Short integer data , Modified can be omitted int.
  2. long: modification int, Long data , Modified can be omitted int.
  3. signed: Modifying integer data , Signed data types .
  4. unsigned: Modifying integer data , The unsigned data type .

C Complex type keywords (5 individual )

  1. struct: Structure declaration
  2. union: Community statement
  3. enum: Enum Declarations
  4. typedef: Declare type aliases
  5. sizeof: Get the size of bytes occupied by a specific type or a specific type variable

D Storage level keywords (6 individual )

  1. auto: Specified as an automatic variable , Automatically allocated and released by the compiler ( Usually allocated on the stack ).
  2. static: Specified as a static variable , Assigned in the static variable area . When modifying a function , Specifies that the function scope is inside the file .
  3. register: Specified as a register variable , It is recommended that the compiler store variables in registers ; You can also modify function parameters , It is recommended that the compiler pass parameters through registers rather than stacks .
  4. extern: Specifies that the corresponding variable is an external variable , That is, the definition in another object file , It can be said that the agreement is declared by another document .
  5. const: And volatile combined term “ cv characteristic ” , The specified variable cannot be used by the current thread / The process changes ( But it could be by the system or other threads / The process changes ).
  6. volatile: And const combined term “ cv characteristic ” , The value of the specified variable may be changed by the system or other threads / The process changes , Force the compiler to get the value of the variable from memory at a time .

The second type of process control keywords

A Jump structure (4 individual )

  1. return: In the body of a function , Returns a specific value ( or void value , That is, no value is returned ).
  2. continue: End the current cycle , Start next cycle .
  3. break: Jump out of the current loop or Switch structure
  4. goto: Jump statements without conditions

B Branching structure (5 individual )

  1. if: Conditional statements
  2. else: Conditional statement negates Branch ( And if Continuous use )
  3. switch: Switch statement ( Multiple branch statements )
  4. case: Branch markers in switch statements
  5. default: In the switch statement “ other ” Branch ( Optional )

C Loop structure (3 individual )

  1. for:for Loop structure for(①;②;③) ④ ; The execution order of is ①→②→④→③→②→④… loop , among ② Is the cyclic condition .
  2. do:do Loop structure do ① while(②) ; The execution order of is ①→②→①→②→①… loop , among ② Is the cyclic condition .
  3. while:while Loop structure while(①) ② ; The execution order of is ①→②→①→②→①… loop , among ① Is the cyclic condition .

Thought I did a good job of cleaning up , Please move your precious finger and give me a compliment .

原网站

版权声明
本文为[52Hertz. six hundred and fifty]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202200513343680.html