In C ++, memory is divided into five blocks: heap, stack, free storage zone, global/static variable zone, and constant storage zone.
STACK: an area that is automatically cleared when the compiler allocates it as needed. It is usually used to store local variables, formal parameters.
Heap: It is generally a Region allocated by new, and the compiler does not care about this storage region, mainly becauseProgramEmployee control, a new corresponds to a delete. If a memory is allocated with new but not released, it will be automatically withdrawn by the system only when the process ends.
Free storage zone: The Zone allocated by malloc is very similar to the heap. The difference is that it is released with free.
Global/static variable area: used to store global and static variables.
Constant storage area: This is a very special area, and programmers are not allowed to modify the volume (if you have to change it, it is also possible, there are many illegal means, explore it by yourself)