C language system learning 1 variables and constants

Freshmen and sophomores have studied C language, c++, java language, and data structure, programming pearls and other courses, but my grasp of knowledge is relatively messy, there is no system, and the programming ability is also somewhat lacking. From the first semester of junior year Start systematic secondary learning and a lot of actual combat, which is a more solid learning method to improve your ability.

Today I learned the first part of the C language, which is a process-oriented language. Relatively basic, but also very common. It is a very classic programming language.

Knowledge point 1: data types

char//字符数据类型
short//短整型
int//整型
long//长整型
long long//更长的整型
float//单精度浮点型
double//双精度浮点型

Knowledge point 2: Variables and constants
Variables: Values ​​that need to be changed and changed are called variables
Constants: Fixed values ​​are called constants
At the same time
, variables are divided into local variables and global variables. Local variables function within a certain scope. The scope of application of global variables is wider. When a local variable has the same name as a global variable, the local variable takes precedence.
Constant classification
1. Literal constants 2. Constant variables modified by const 3. Identifier constants defined by #define 4. Enumeration constants
knowledge point 3: Scope and declaration cycle
The
scope of code that can be used by this variable is the function of this name The scope of the corresponding local variable is the local scope where the variable is located, and the scope of the global variable is the entire project.

Guess you like

Origin blog.csdn.net/qq_45742383/article/details/113408341