定义了这样一个结构体struct st2
{
int x;
st1 y[dim]; // 其中st1为另一个结构体,dim为维数
};如果令dim=99,999的常量时,则出现如下的错误:
fatal error C1126: automatic allocation exceeds 2G请教高手如何解决??因为我必须要定义这么大的一个结构体,谢谢~
{
int x;
st1 y[dim]; // 其中st1为另一个结构体,dim为维数
};如果令dim=99,999的常量时,则出现如下的错误:
fatal error C1126: automatic allocation exceeds 2G请教高手如何解决??因为我必须要定义这么大的一个结构体,谢谢~
不一定要定义在结构体里,放出来动态申请就好了 st1 *p_y = new st1[dim];就好了
楼主一下子分配那么大的空间,肯定回出错的。
要解决这个问题可以进行文件操作,还有就是增大进程空间(这种方法目前使用较少)。
only static const integral data members can be initialized within a class
我是不懂
不懂为啥在CPP文件里定义这样的变量就可以,上面那些是定义在头文件里的
{
int x;
st1* ; // 其中st1为另一个结构体,dim为维数
};
y = new st1[V];