Clion退出代码-1073741571(0xC00000FD) [英] Clion exit code -1073741571 (0xC00000FD)

查看:934
本文介绍了Clion退出代码-1073741571(0xC00000FD)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我得到了一个奇怪的退出代码:

I get a weird exit code in clion:


退出代码-1073741571(0xC00000FD)

exit code -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;
}

我对此进行了测试并找出原因:

I tested it and find out its because of this line:

int arr[30007][5];

声明数组大小小于1.000.000时我没有问题 2天前,现在我收到此错误。
我没有在Clion中进行任何更改。

I had no problem in declaration of array in size of less than 1.000.000 2 days ago and now I get this error. I changed nothing in Clion.

我该怎么办?

推荐答案

错误号 0xC00000FD 代表堆栈溢出(我想您的平台是Windows)。在Windows下,本地变量在堆栈上分配(与其他大多数平台一样), int arr [30007] [5] 很大(30007 * 5 * 4 = 600140字节)和堆栈通常很小(通常约为1 Mb,又取决于平台)

The error number 0xC00000FD stands for "stack overflow" (I suppose your platform is Windows). Under Windows local variables are allocated on the stack (as on most other platforms too) and int arr[30007][5] is pretty big (30007 * 5 * 4 = 600140 bytes) and stacks are usually rather small (typically around 1 Mb, again platform dependant)

您有很多选择:


  1. 使用 std :: vector 代替原始数组(首选)

  2. 将数组声明为静态( static int arr [30007] [5]; ),那么它将不再驻留在堆栈中

  3. 增加可执行文件的堆栈大小。这是高度依赖平台的工具。

  4. 动态分配数组

  1. use std::vector instead of raw arrays (preferred)
  2. declare the array as static (static int arr[30007][5];), then it won't reside on the stack anymore
  3. increase the stack size of your executable. This is highly platform/too dependant.
  4. allocate the array dynamically

这篇关于Clion退出代码-1073741571(0xC00000FD)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆