Record on the first day

I have watched a few lessons from Mr. Hao Bin before, and now I am ready to watch the video of Bitepeng, mainly because Hao Bin shared the courses ten years ago. There may be some updates during this period. Thank you for the free videos shared by these teachers. (Three grams of oil!)

Simply remember some simple content:
data type:

char //Character data type
short //short integer //%c--printing character
int //integer //%d printing integer
long //long integer //%p--printing
long as an address long //Longer integer
float //Single-precision floating-point number//%f--Print floating-point number
double //Double-precision floating-point number

Type usage:
char ch ='w';
int weight = 120;
int salary = 20000;

Variables and constants
Some values ​​in life are constant (pi) and
some values ​​are variable. The method of

defining variables

int age = 150;
float weight = 45.5f;
char ch = 'w';

Variable classification
1, local
2, global

When the local variable and the global variable have the same name, the local variable is used first

Variable scope and life cycle
scope : (scope), program concept design, generally speaking, the name used in a piece of program code is not always valid\available
and the scope of the usability code that limits this name is this name The scope of
1, the scope of local variables is the local scope of the variable
2, the scope of global variables is the entire project

The life cycle of a life cycle
variable refers to a period of time between the creation of a variable and the destruction of a
variable. The life cycle of a local variable is: entering the role and the beginning of the life cycle, going out and ending the life cycle
2. The life of the global variable The cycle is: the life cycle of the entire program

Guess you like

Origin blog.51cto.com/15082590/2589221