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