【发布时间】:2016-06-12 14:07:01
【问题描述】:
我尝试从互联网上编译一些 c++ 代码 (http://arma.sourceforge.net/shadows/)。
编译代码时,初始化数组时出现错误。 示例(来自代码-> GaussianMixtureModel.cpp Line:122):
void function()
{
int k = Vector.size();
uchar* Ptrs[k];
// Does somthing with the Ptrs
}
我还尝试将其编辑为以下内容:
const int k = Vector.size();
但它没有用。我将不胜感激!
我正在使用 Visual Studio 2012。
感谢您的回答!
【问题讨论】:
-
你可以用
operator new和operator delete在堆上分配它 -
你也可以粘贴你得到的编译错误吗?