SmartVessel

Foucs on C++

博客园 首页 新随笔 联系 订阅 管理

To simplify just a bit, there are basically three main storage areas you need to be concerned with:

  1. Global data -- a single static memory location outside the stack or heap. These are the variables declared not local to any function. (The distinction evident by the C/C++ "static" keyword is really just about which parts of the program are aware of the name of a global variable.)

  2. Stack data -- dynamic, but pushes and pops with function calls.

  3. Heap data -- the stuff returned by new/malloc, truly dynamic and the memory persists until a delete/free, rather than when functions exit.

posted on 2011-04-13 10:26  SmartVessel  阅读(229)  评论(0编辑  收藏  举报