automatic-storage

Why are the terms “automatic” and “dynamic” preferred over the terms “stack” and “heap” in C++ memory management?

我是研究僧i 提交于 2019-11-26 10:45:09
Related to a lot of questions and answers on SO, I've learned that it's better to refer to objects whose lifetime is managed as residing in automatic storage rather than the stack. Also, dynamically allocated objects shouldn't be referred to as residing on the heap, but in dynamic storage. I get that there is automatic, dynamic and static storage, but never really understood the difference between automatic-stack and dynamic-heap. Why are the former preferred? I'm not asking what stack/heap mean or how memory management works. I'm asking why the terms automatic/dynamic storage are preferred

Why are the terms “automatic” and “dynamic” preferred over the terms “stack” and “heap” in C++ memory management?

混江龙づ霸主 提交于 2019-11-26 02:01:42
问题 Related to a lot of questions and answers on SO, I\'ve learned that it\'s better to refer to objects whose lifetime is managed as residing in automatic storage rather than the stack. Also, dynamically allocated objects shouldn\'t be referred to as residing on the heap, but in dynamic storage. I get that there is automatic, dynamic and static storage, but never really understood the difference between automatic-stack and dynamic-heap. Why are the former preferred? I\'m not asking what stack