Memory distribution in C language

Source: Internet
Author: User

Code snippet: A piece of memory area used to store program execution code. This portion of the memory size is known before the program is run and is usually read-only, including read-only string constants, immutable

BBS segment: Used to store the uninitialized global variables and static variables, belonging to the static memory allocation.

Data segment: Used to store initialized global variables and static variables, which are static memory allocations.

Heap: A memory that is allocated dynamically during the execution of a program and is not fixed in size. For example, the newly allocated memory in malloc is added to the heap, and the heap is shrunk when the free operation is performed.

Stack: Stores non-static local variables that are used to pass parameters and return values when the function is called.

Such as:

Memory distribution in C language

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.