In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
A typical C program storage partition consists of the following categories:
Text segment initialized segment uninitialized segment stack
Previously, there was some confusion about the arrangement of variables in C language in memory, so I briefly sorted out the following aspects (all the examples are compiled based on GCC on X86 PC Ubuntu).
When a variable is defined, the growth direction of the memory address allocated by different variables
(1) define two global variables, print their assigned address in memory after assignment compilation, and find that the previously defined variable is allocated in the low address in memory.
(2) define variables in the main function of X86 PC Ubuntu, and use gcc to view the memory addresses assigned to the variables by the system at compile time (memory allocation increases from low to high addresses)
After the structure body is instantiated, the growth direction of the memory address allocated by the members in the structure
(1) define the global structure and initialize it. After gcc compilation, check the growth direction of memory allocation of structure members (the growth direction of memory allocation is from low to high)
(2) initialize the structure in the main function, and check the growth direction of memory allocation of structure members after gcc compilation (the growth direction of memory allocation is from low to high)
The growth direction of the memory of the stack space used when defining variables in the function
When arm uses arm to cross-compile the tool chain, the general memory allocation of variables is in the upward direction, but for the memory allocation on the stack, the memory on the stack is allocated to the variables, and the stack growth direction is in the downward direction.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.