“动态存储"的技术定义是什么?在C ++中 [英] What is the technical definition of "dynamic storage" in C++
问题描述
标题说的是:"C ++中动态存储的技术定义是什么?"我很好奇如何在堆上讨论动态内存分配而又不会在我的解释中犯任何错误.
Just what the title says, "What is the technical definition of dynamic storage in C++?" I'm curious as to how to discuss dynamic memory allocation on the heap without making any mistakes in my explanation.
推荐答案
来自 C ++编程语言:特别版
免费存储,对象从中显式请求对象的内存 该程序以及程序可以在其中再次释放内存的位置 (使用
new
和delete
).当程序需要更多免费时 存储,new
从操作系统请求它.通常, 免费存储(也称为动态内存 或堆)在程序的整个生命周期内都在增长,因为没有 内存曾经返回给操作系统供其他人使用 程序.
Free store, from which memory for objects is explicitly requested by the program and where a program can free memory again once it is done with it (using
new
anddelete
). When a program needs more free store,new
requests it from the operating system. Typically, the free store (also called dynamic memory or the heap) grows throughout the lifetime of a program because no memory is ever returned to the operating system for use by other programs.
这篇关于“动态存储"的技术定义是什么?在C ++中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!