Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/160.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/fortran/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ Clion退出代码-1073741571(0xC00000FD)_C++_Clion - Fatal编程技术网

C++ Clion退出代码-1073741571(0xC00000FD)

C++ Clion退出代码-1073741571(0xC00000FD),c++,clion,C++,Clion,我在clion中得到一个奇怪的退出代码: 退出代码-1073741571(0xC00000FD) 这是我的代码: int main() { std::cin.sync_with_stdio(false); std::cin.tie(nullptr); freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); int n = 0, i = 0, j = 0; int

我在clion中得到一个奇怪的退出代码:

退出代码-1073741571(0xC00000FD)

这是我的代码:

int main()
{
    std::cin.sync_with_stdio(false);
    std::cin.tie(nullptr);

    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);

    int n = 0, i = 0, j = 0;
    int arr[30007][5];

    for (i = 1; i <= 30000; i++)
        arr[0][i] = 1;

    //...

    return 0;
}
两天前,我在声明小于1.000.000的数组时没有问题,现在我得到了这个错误。 我没有改变克莱恩


我该怎么办?

错误号
0xc0000fd
代表“堆栈溢出”(我假设您的平台是Windows)。在Windows下,本地变量在堆栈上分配(在大多数其他平台上也是如此),并且
int-arr[30007][5]
相当大(30007*5*4=600140字节),堆栈通常相当小(通常约1MB,同样取决于平台)

您有很多选择:

  • 使用
    std::vector
    代替原始数组(首选)
  • 将数组声明为static(
    static int arr[30007][5];
    ),那么它将不再驻留在堆栈上
  • 增加可执行文件的堆栈大小。这高度依赖于平台/过于依赖
  • 动态分配阵列

  • 如清单所示(假设您使用的平台是Windows),它是异常代码,等于“STATUS\u STACK\u OVERFLOW”。堆栈大小通常很小,这样的数组已经占用了约0.57MB的空间。我改为静态,它工作了。但我主要使用这个:long-long-int-arr[500000],没有问题。现在发生了什么?!可能是windows更新吗?可能是该版本的堆栈更大。堆栈大小不是C语言的问题,而是构建工具(C编译器和链接器)的问题。我不知道如何更改平台上的堆栈大小。
    int arr[30007][5];