Answer: The memory occupied by a program compiled by C/C++ is divided into the following parts:
1. Stack area (stack) - automatically allocated and released by the compiler, storing function parameter values, local variable values, etc. Its operation is similar to the stack in the data structure.
2. Heap area (heap) - generally allocated and released by the programmer. If the programmer does not release it, it may be reclaimed by the OS when the program ends. Note that it is different from the heap in the data structure, and the allocation method is similar to a linked list, haha.
3. Global area (static area) (static) - global variables and static variables are stored together, initialized global variables and static variables are in one area, uninitialized global variables and uninitialized static variables are in another adjacent area. Released by the system after the program ends.
4. Text constant area - constant strings are placed here. Released by the system after the program ends.
5. Program code area - stores the binary code of the function body
Example program
This is written by a senior, very detailed
//main.cpp
}
Previous article:MCU simulates serial port transmission and baud rate issues
Next article:struct and typedef struct
- Popular Resources
- Popular amplifiers
- Naxin Micro and Xinxian jointly launched the NS800RT series of real-time control MCUs
- How to learn embedded systems based on ARM platform
- Summary of jffs2_scan_eraseblock issues
- Application of SPCOMM Control in Serial Communication of Delphi7.0
- Using TComm component to realize serial communication in Delphi environment
- Bar chart code for embedded development practices
- Embedded Development Learning (10)
- Embedded Development Learning (8)
- Embedded Development Learning (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Intel promotes AI with multi-dimensional efforts in technology, application, and ecology
- ChinaJoy Qualcomm Snapdragon Theme Pavilion takes you to experience the new changes in digital entertainment in the 5G era
- Infineon's latest generation IGBT technology platform enables precise control of speed and position
- Two test methods for LED lighting life
- Don't Let Lightning Induced Surges Scare You
- Application of brushless motor controller ML4425/4426
- Easy identification of LED power supply quality
- World's first integrated photovoltaic solar system completed in Israel
- Sliding window mean filter for avr microcontroller AD conversion
- What does call mean in the detailed explanation of ABB robot programming instructions?
- STMicroelectronics discloses its 2027-2028 financial model and path to achieve its 2030 goals
- 2024 China Automotive Charging and Battery Swapping Ecosystem Conference held in Taiyuan
- State-owned enterprises team up to invest in solid-state battery giant
- The evolution of electronic and electrical architecture is accelerating
- The first! National Automotive Chip Quality Inspection Center established
- BYD releases self-developed automotive chip using 4nm process, with a running score of up to 1.15 million
- GEODNET launches GEO-PULSE, a car GPS navigation device
- Should Chinese car companies develop their own high-computing chips?
- Infineon and Siemens combine embedded automotive software platform with microcontrollers to provide the necessary functions for next-generation SDVs
- Continental launches invisible biometric sensor display to monitor passengers' vital signs
- The first embedded systems trade fair will be held
- Backpack solar panel modification
- Ultra-wideband technology UWB knowledge
- How is your circuit preparation going?
- How to configure the input and output of a DSP's GPIO?
- Some expansion module products of Raspberry Pi PICO
- How to use wireless firmware upgrades for MSP 430 microcontrollers
- The ultimate reason for high-frequency radiation exceeding the standard
- MicroPython adds support for STM32L432KC
- STM32G474RET6, using HRTIM, outputs dual-channel Dual DAC sine waves in DMA mode