我定义一个数组:
CONST int myArr[700000];运行时出现"stack over flow"
难道数组大小有规定吗?请赐教

解决方案 »

  1.   

    const int myArr[700000];
    首先应该初始化。
      

  2.   

    to helloair:
    不行 tks
      

  3.   

    动态创建。
    int* nArray = new int [nNum];
      

  4.   

    在栈中分配 int[700000] = 2.8MB 这样的数组当然会 stack over flow,通常情况 stack < 1MB动态分配或 static 是可以的
    const int *pmyArr = new int[700000];
    // or 
    static int myArr[700000];