Local variables:
Concept: defining function Internal variables
Definition Format: Variable type variable name;
Scope: Starts from the definition of the line to the end of the block of code
Life cycle: From code execution to what line of definition begins, until the end of the code where it resides
Feature: You cannot have a variable of the same name in the same code block
Different code blocks can have variables with the same name, and internal variables override externally defined variables
Global variables:
Concept: Defining variables outside the function
Definition: Variable type variable name = value;
Declaration: Variable type variable name;
Features: 1, can not be repeated definition, but can be repeated declaration
2, the local variable can be the same name as the global variable, within the scope of the local variable, then the local variable will overwrite the global variable
3, if there is no definition of only declarations, the system automatically defines it and initializes it to 0
Scope: Starts from the defined line until the end of the file
Life cycle: Starts from the start of the program until the program exits
C Language: Global variables and local variables