C ++: automatic storage, static memory, dynamic memory

1. Automatic storage

At the end of the life cycle, it is released automatically.

2. static storage

Keywords: static

The entire program execution will not be released.

Outside a function or variable defined using the keyword static.

3. Dynamic memory

a new, must delete released at the end of the life cycle pointer variable is requested to release the space will be inaccessible but has not been released, which is a memory leak.

Guess you like

Origin www.cnblogs.com/ScarecrowMark/p/11899676.html