Continue with the C + + premier Plus
First to explain the scope and linkage, the so-called scope, refers to the scope of the variable, so-called linkage, refers to whether the variable can be shared in different files
1, Auto variable (automatic variable), local scope, no linkage
The parameters of the function, variables defined within the function (without static qualification), and variables defined in the statement block are automatic variables, with the local scope, which is the localized scope, only works in the defined function or block, and when the program executes away from a function or chunk, Where the automatic variable is freed (free) off
2, static variable (variable), three kinds of external linkage,internal linkage and no linkage
Static variables exist as long as the program is running, and will not be released. Declare a static variable of external linkage, declare it outside of all functions or chunks, declare a static variable internal linkage, precede the variable with a "static" qualifier, and a static variable to declare no linkage. Declaring a variable of type static within a block or function can
Memory Models and Namespace