栈是在运行时分配还是编译时分配?
示例:
void main()
{
int x;
scanf("%d", &x);
int arr[x];
}
最佳答案
堆栈在运行时分配;然而,每个堆栈帧的布局是在编译时决定的,可变大小数组除外。
关于c - 栈内存是在运行时分配的还是编译时分配的?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10822176/