The distribution of C + + programs in storage

Source: Internet
Author: User

From low address to high address:

1. Code area "contains constant": binary code that holds the body of the function

2. Global variable Area "initialized + uninitialized":

The storage of global variables and static variables is put together, initialized global variables and static variables in an area, uninitialized (global variables and static variables) in another adjacent area. System released after the program is finished

3, Heap: by the programmer assigned to release, if the programmer does not release, the end of the program may be recycled by the OS. Note that it is not the same as the heap in the data structure, but the distribution is similar to the linked list,

4, Stack: automatically allocated by the compiler release, stored function parameter value, local variable value and so on. It operates in a manner similar to a stack in a data structure.

      

The distribution of C + + programs in storage

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.