Http://hi.baidu.com/keeekee/blog/item/95564b7a34c3d0ee2e73b3ae.html
1. allocated from the static storage area.
InnerProgramIt is allocated during compilation. This program exists throughout the running period.
Such as global variables and static variables.
2. Create a stack.
When executing a function, all the storage units of local variables in the function can be created on the stack;
These storage units are automatically released at the end of function execution.
Stack memory allocation operations are embedded in the processor's instruction set. High efficiency, but the allocated memory capacity is limited.
3. Allocate from the stack, also known as dynamic memory allocation.
When the program is running, use malloc or new to apply for any amount of memory,
The programmer is responsible for releasing the memory with free or delete.
The lifetime of the dynamic memory is specified by us.