【发布时间】:2014-04-18 16:28:46
【问题描述】:
我写了以下代码:
int tester(int n)
{
int arr[n];
// ...
}
此代码已编译,没有警告,使用 g++。
我的问题是 - 如何?参数 n 仅在运行时已知,在数组中是静态分配的。 gcc是怎么编译的?
【问题讨论】:
-
您是在问这是如何实现的,或者考虑到它不是合法的 C++,为什么要编译?
-
@juanchopanza 这是如何实现的?
标签: c++ gcc static-allocation