首页 > 电子期刊 > J > 计算机时代

C++语言内存分配研究

摘 详细阐述C++编译器内存分配形式给出堆栈文字常量区寄存器区静态区程序代码区分配策略分析内存分配中易产生问题导致程序运行出错原因解决办法从避免程序异常内存错误保证程序健壮性正性关键词 内存 堆 栈 C++语言中图分类号TP312 文献标志码A 文章编号1006-8228201405-44-03Abstract The memory allocation strategy C++ compiler is described in detail in this paper. The distribution strategy of heap stack literals memory register memory in C++ language is given. The causes and the solution of memory allocation problems and program running error are analyzed to avoid exception and memory errors and guarantee the correctness and robustness of program.Key words memory heap stack C++ language0 引言C++编译器根据数据内存中生存期将用户使用内存分程序区静态存储区动态存储区个区域其中动态存储区分堆区栈区寄存器区1 内存分配形式C++中内存分配形式下种1.1 栈区stack栈编译器自动分配释放用于存放函数参数值局部变量值等栈块连续内存区域大小2M固定常数因程序中变量能从栈中获取空间较少若栈剩余
下一页>>

首页 > 电子期刊 > J > 计算机时代

广州市越秀区图书馆版权所有。
联系电话:020-87673002

本站访问人数: