avatar
l*y
1
someone said stack memory can also be dynamically allocated. yes stack the
stack memory,not heap.
is this possible? and how?
avatar
l*g
2
comfort, 看来你碰到了一个爱考茴香的茴有几种写法的孔乙己式牛人
有个alloca function, 可以用来在dynamically allocate memory in stack. 但是这
个function,
不是C++ standard, 不是所有compiler都support, 而且只能allocate很少量memory,
否则很容易
causes stack overflow.
总之, 用alloca不是good practice. 需要用alloca的case, 都可以用一个fixed or
dynamic array来解决

【在 l********y 的大作中提到】
: someone said stack memory can also be dynamically allocated. yes stack the
: stack memory,not heap.
: is this possible? and how?

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。