1, can local variables and global variable duplicate?
A: Yes, the local will screen the overall situation. To use a global variable, you need to use the "::"
Local variables can have the same name as global variables, and when referenced within a
1. Can a local variable be renamed with a global variable?
A: Yes. Global blocking will be performed in some cases. To use global variables, you must use "::"
A local variable can have the same name as a global variable. A local variable with the
Static can be used in either of the following ways:Process-orientedProgramDesignStatic andObject-Oriented ProgrammingStatic. The former applies to common variables and functions, and does not involve classes. The latter mainly describes the role of
a.introduction (32-bit system)
Linux simplifies the fragmentation mechanism so that virtual addresses (logical addresses) and linear addresses are always consistent, so the virtual address space for Linux is also 0~4g (2^32).
The Linux kernel
There are two ways to use static: process-orientedProgramStatic in design and static in object-oriented programming. The former applies to common variables andFunction, which does not involve classes. The latter mainly describes the role of static
Memory allocation of a program
The memory consumed by a program compiled by C + + is divided into the following sections:
1, stack area (stack)-by the compiler automatically assigned to release, store the function of the parameter values, local
Original blog, reprint please indicate the source--Zhou Xuewei http://www.cnblogs.com/zxouxuewei/Static is used in two ways: static in process-oriented programming and static in object-oriented programming. The former applies to ordinary variables
Differences among global variables, local variables, static global variables, and static local variables in memory
I. program memory allocation
The memory occupied by a C/C ++ compiled program is divided into the following parts:
1. stack )-Released
Differences between global variables, local variables, static global variables, and static local variables
C ++ variables have different scopes based on different lifecycles at defined locations. They can be divided into six categories: global
1. From the scope view:1> Global variables have global scope. A global variable can be used for all source files simply by defining it in one source file. Of course, other source files that do not contain global variable definitions need to declare
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.