自动/静态内存分配 [英] automatic/static memory allocation

查看:60
本文介绍了自动/静态内存分配的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

也许是一个幼稚的问题,但是...

Maybe a naive question, but...

确认或拒绝:

Confirm or deny:

自动和静态存储持续时间的对象/变量的内存的存在是由编译时确定的,并且由于没有足够的内存来存储自动对象,因此程序在运行时失败的可能性绝对为零. /em>

The existence of memory for objects/variables of automatic and static storage duration is determined compile-time and there is absolutely zero chance that the program will fail runtime because there wasn't enough memory for an automatic object.

自然地,当自动对象的构造函数执行动态分配而这种分配失败时,我们认为这是动态分配的失败,而不是自动的.

Naturally, when the constructor of an automatic object performs dynamic allocations and such allocation fails, we consider this to be a failure on dynamic allocation, and not automatic.

推荐答案

两个词:堆栈溢出. :P

这篇关于自动/静态内存分配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆