期刊文献+

C++中内存分区及堆、栈概念详解 被引量:1

Memory allocations and Concept of Stack and heap in C++
下载PDF
导出
摘要 使用C++编程时,内存分为五个区:堆、栈、自由存储区、全局/静态存储区与常量存储区。用new来分配堆,用delete来释放;它的操作灵活,可用空间大,但容易产生碎片。栈由编译器自动分配释放,有专门的入栈出栈指令,具有较高的效率。在编程时根据实际情况合理选择堆或者栈,可以提高程序的效率与可靠性。 There are five kind of memory allocations in programming with C++: Heap, Stack, Free memory block, Globle/Static variable memory block and Const variable memory block. Heap is allocated by operator 'new', and released by operator 'delete'. It's easy to be realized and has perfect usage of memory. Stack is automatically allocated and released by C++ complier. It has more efficiency using specific push/pop instructions. We should make a reasonable selection between heap and stack by actual circumstance in order to improve efficiency and reliability when programming.
作者 陈利
机构地区 芜湖教育学院
出处 《芜湖职业技术学院学报》 2006年第2期19-20,共2页 Journal of Wuhu Institute of Technology
关键词 内存分区 区分 内存大小 越界 memory allocation heap stack distinction memory size overflow
  • 相关文献

同被引文献2

引证文献1

相关作者

内容加载中请稍等...

相关机构

内容加载中请稍等...

相关主题

内容加载中请稍等...

浏览历史

内容加载中请稍等...
;
使用帮助 返回顶部