C language learning summary _01

1. The data types in C language are actually divided into two categories: integer and floating point

  整型:char,short,int,long,long long
  浮点型:float,double

2. Sizeof is a keyword, not a function. There is no string type in C language, but there is string content.
3. Process-oriented thinking: take one step, look one step, cross the river by feeling the stones, and write what you need.
4. A few notes about the static keyword:
static in the C language is used to modify variables and functions.
1) Modification of local variables-static local variables: The life cycle of the variable is changed, so that the static local variable still exists out of the scope, and the life cycle ends when the program ends. There are also variables that are initialized only once, and there is a small application scenario: count how many times each function is called in a project, you can add a counter inside the function, and the variables are modified with static to analyze which functions are in a project Affected performance.
2) Modified global variable-static global variable: The global variable can only be used in this file, changing its scope.
3) Modified function-static function: before static, functions and global variables can also be used across files, but with static modification, this function can only be used in this file.
5. There are 32 keywords in the c language.
6.
First acquaintance with pointers: 1): Why there are pointers: For the CPU to find data in the memory efficiently, it can be compared to the house number in life.
2) Pointers and pointer variables:
pointers are addresses, pointer variables store pointers (addresses).
On a 32-bit system platform, the pointer size is 4 bytes, and it is 8 bytes on a 64-bit system platform.
3) What is dereferencing: *p: Dereferencing a pointer variable represents the target pointed to by the pointer (address).

Guess you like

Origin blog.csdn.net/CZHLNN/article/details/108987723