Understand the benefits of the compilation process
C + + Engineering-related issues
What is a library? What's the difference between a static library and a dynamic library?
What role does the header file play?
Next, we will analyze the location of different lifecycle variables in the process space.Int x = 0x1234; // global initialization variableChar * s; // global uninitialized variableInt test (){Static int I = 0x4567; // static local variableReturn ++
The knowledge points learned in this lesson:(1) Taking the digital pyramid as an example, introduces another form of function, that is, a function that does not return a result. Functions that do not return results are identical in definition,
A binary image file that is formed after a compiled connection from a C + + program that contains:Stacks, heaps, data segments (read-only data segments, initialized read and write data segments, uninitialized data segments, BBS), and code snippets.1.
1), the variable used to declare the function body is a static local variable, stored in a static data store, maintain its value in the process of the function is called unchanged2), within the file (outside the function body) is declared as a
/* What is an empty hanging pointer: the lifetime and end of the storage area to which the pointer points, but the lifetime of the pointer has not ended, resulting inThe data in the bucket has been released, and the pointer refers to a random value
The following two articles are analyzed in detail.
Source http://blog.csdn.net/shiwei0124/archive/2009/11/26/4877546.aspx
String storage and static storage areas, stacks, and stacks
Occasionally, a string problem occurs during programming. It seems
4. Function Design
Functions are the basic functional units of C ++/C Programs. Their importance is self-evident. The minor disadvantage of function design can easily lead to incorrect use of the function. Therefore, it is not enough to make the
Parameter rules
(A) The parameter must be completely written. Do not worry about writing only the parameter type, but omit the parameter name. If the function has no parameters, use void.
(B) The parameter name should be appropriate and the order
The static function of C ++ has two usage methods: static in process-oriented programming and static in object-oriented programming. The former applies to common variables and functions, and does not involve classes. The latter mainly describes the
Released on: 3/16/2005 | updated on: 3/16/2005
K. Scott Allen
This article discusses:
•
Performance and behavior of Type constructor
•
Static member and thread security
1. first introduce the first and most important one: Hide. (Static function, static variable)
When multiple files are compiled at the same time, all global variables and functions without the static prefix are globally visible.For example. Compile
Static Keywords of C ++
The static function of C ++ has two usage methods: static in process-oriented programming and static in object-oriented programming. The former applies to common variables and functions, and does not involve classes. The
Attributes of Variables
1, Variable Classification
L according to scope: it can be divided into global variables and local variables.
L according to the life cycle: it can be divided into static storage and dynamic storage, specifically divided
Swift global variables, local variables and type attributes, swift global variables
Global and local variables
The pattern described by the calculation property and property monitor can also be used for global variables and local variables. global
Understand local, global, static, dynamic, and external variables
1. All variables and local variables
Local variables: variables defined in the function. The scope is the function's internal eg: void fun () {int x ;}
All variables: can be defined
1) AutoThis keyword is used to declare that the lifetime of a variable is automatic. Variables not defined in any class, structure, enumeration, union, or function are considered global variables, the variables defined in the function are considered
Extern and static can be used to modify variables and functions. What is the difference and usage.
1. Variables
By storage type, there are four types of variables in C language:
The auto keyword, which can be omitted. For example, int I; variable
C ++ all keywords
(1) Auto
This keyword is used to declare that the lifetime of a variable is automatic, and variables not defined in any class, structure, enumeration, union, or function are considered global variables, the variables defined in the
A static local variable
1 storage space allocation scope lifetime
Static is allocated in the static storage area, and the scope is limited to the internal function that declares the variable. InProgram
The entire running period is not released,
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.