C Language Variable storage type
AutoStaticexternstatic externRegister
Auto local variable
The auto variable occupies the storage space in stack mode, so when this section is executed, the system immediately allocates the memory space for the
The variables in C language are divided into four categories, respectively
1.auto Automatic variable
2.static Static Storage allocation variable (also divided into internal static and external static)
3.extern whole variable (for external variable
C + + More emphasis on language practicality1. All variables can be defined when they need to be usedIint 0 ; for (int i=1; i3; i++) { for (int j=1; j 3; J + +) {+ = i * j; } } 2. Register
Upgrade from C to C ++ to c ++
I. Relationship between C and C ++
1. C ++ inherits all the features of C Language
2. C ++ provides more syntaxes and features based on C.
3. The objective of C ++ is to unify the running efficiency and development
1. register variableThe keyword regiter requests the compiler to store the variable in the CPU register as much as possible. Note the following points.1. The register variable must be a type that can be accepted by the CPU register. This usually
Note: This C language topic is a prelude to iOS development. To enable programmers with object-oriented language development experience to quickly get started with the C language. If you have no programming experience or are not interested in C and
[Programming language] The storage period/scope of the variable and the usage of static/extern, staticextern
Storage Class:
Linked Memory Management During Storage Period
For a variable (Different Storage types), you can describe it through the
Embedded C language programming knowledge
1. When the assembly line is filled with instructions, the maximum efficiency can be realized. That is, an instruction is executed every clock cycle (only a single-cycle instruction ). If the program jumps,
Storage class:Storage Time link Memory managementFor a variable (a different storage type) it can be described by the storage period, the link property, and the corresponding scope.The storage period is the time the variable is held in memory, and
Usability "enhancedVariables in the C language must be defined at the beginning of the scope!!More emphasis is placed on the "practicality" of language in C + +, and all variables can be defined when they need to be used.int main () { inti =
Starting today, prepare to re-learn the C language. Although I understand the C language grammar, but always feel that understanding is not enough. For a variety of reasons, the previous study of C language has always been unable to persist, but
The scope of a variable
Second, the storage type of the variable
Description: This C language topic is the prelude to learning iOS development. And for programmers with an object-oriented language development experience, you can
Register Keyword: The request compiler lets the variable be placed directly inside the CPU internal registers, rather than through memory addressing access, fast.In C, the register-modified variable cannot take the address, and the address of the
variable is the C language is the most basic and core concept, C variables are more complex, here to do a summary, hope to learn C brothers help. Recognition variable variable literal meaning is a variable data, the data has a variety of
First, a few concepts:1. From the lifetime of the variable, can be divided into static storage mode and dynamic storage modestatic Storage: How the system allocates a fixed amount of storage space (global variables) during program runDynamic storage:
Variables in the C language can have their own properties
You can add the "Properties" keyword when you define a variable
The "Properties" keyword indicates the unique meaning of a variable
1:auto
Auto is the default property of local variables
Static in C can be used to modify variables, or to modify functions.First look at the time to modify the variable. Variables in C can be divided into the existence of global data areas, stacks and heaps. In fact, we usually say the stack is stack
In C + +:
(1) The Register keyword cannot define a variable in the global, or it will be prompted as an incorrect storage class.
(2) when the Register keyword is declared in a local scope, the address can be taken with the & operator, and once the
Today, my friend asked me about the second LoadRunner script, and I told him there was nothing. To learn a language, basic grammar and thought are important. Now everyone is literate, and that is not every literate person can be a writer. Impossible,
The precedence of the not equal to operator! = is higher than the precedence of the assignment operator =;
The parameter value passed to the called function is stored in a temporary variable, not in the original variable, so the called function
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.