c++ grill# JobHunting - 待字闺中l*y2011-03-28 07:031 楼someone said stack memory can also be dynamically allocated. yes stack thestack memory,not heap.is this possible? and how?
l*g2011-03-28 07:032 楼comfort, 看来你碰到了一个爱考茴香的茴有几种写法的孔乙己式牛人有个alloca function, 可以用来在dynamically allocate memory in stack. 但是这个function,不是C++ standard, 不是所有compiler都support, 而且只能allocate很少量memory,否则很容易causes stack overflow.总之, 用alloca不是good practice. 需要用alloca的case, 都可以用一个fixed ordynamic array来解决【在 l********y 的大作中提到】: someone said stack memory can also be dynamically allocated. yes stack the: stack memory,not heap.: is this possible? and how?