Process finished with exit code -1073741571 (0xC00000FD)

用clion写归并排序的时候出现了这个代码,然而代码在oj上是可以运行得到正确结果的。所以就好奇这个错误是什么原因。

网上搜了一下,错误代码对应的错误是Stack overflow,栈溢出。应该是和递归的代码有关系。看了下递归的代码:

void mergeSort(int q[], int l, int r){if (l >= r) return;int mid = (l + r) / 2;mergeSort(q, l, mid);mergeSort(q,mid + 1, r);int left = 0;int right = mid + 1;int temp[N];int k = 0;while (left <= mid && right <= r)if (q[left] < q[right]) temp[k++] = q[left++];else temp[k++] = q[right++];while (right <= r)  temp[k++] = q[right++];while (left <= mid)  temp[k++] = q[left++];for (int i = l, j = 0; i <= r; i++, j++) q[i] = temp[j];
}

中间有一句:int temp[N];。这实际上就是错误的根源。在递归的函数中如果有占用空间比较大的数组的话,将其变为全局变量即可。

#include <iostream>
using namespace std;const int N = 1e5 + 10;
int q[N];
int n;
int temp[N];void mergeSort(int q[], int l, int r){...
}

这样就可以顺利运行了。

Process finished with exit code -1073741571 (0xC00000FD)的解决方案相关推荐

  1. python Process finished with exit code -1073741571 (0xC00000FD)

    注意:本文提供的三种方法仅供参考,未必一定能解决您的问题!如别无他法,可以一试. 跑程序时遇到这样的错误代码,Process finished with exit code -1073741571 ( ...

  2. 解决报错Process finished with exit code -1073741571 (0xC00000FD),修改栈大小

    运行程序时程序意外终止,并返回提示: Process finished with exit code -1073741571 (0xC00000FD) 导致的原因是StackOverflow(栈区溢出 ...

  3. 报错Process finished with exit code -1073741571 (0xC00000FD) 程序是否可以完成

    这个错误代码 -1073741571 (0xC00000FD) 表示程序运行时发生了栈溢出.栈溢出通常是由于程序递归调用次数太多导致的,或者因为程序分配了太多内存导致栈空间不足. 这个错误通常不能被程 ...

  4. Python开启尾递归优化,解决Process finished with exit code -1073741571 (0xC00000FD)

    首先,递归调用是函数调用自己本身,在计算机中,函数调用是通过栈(stack)这种数据结构实现的,每当进入一个函数调用,栈就会加一层栈帧,每当函数返回,栈就会减一层栈帧.由于栈的大小不是无限的,所以,递 ...

  5. PyCharm——运行错误【Process finished with exit code -1073741819 (0xC0000005)】解决方案之一

    解决方案 以管理员身份运行PyCharm. 参考文章 pycharm报错:Process finished with exit code -1073741819 (0xC0000005)

  6. python Process finished with exit code -1073741819 (0xC0000005) 解决

    运行程序时,Process finished with exit code -1073741819 (0xC0000005) 报错 原因:没有 python33.dll 在 c:\WINDOWS\sy ...

  7. Process finished with exit code -1073741819 (0xC0000005)

    Process finished with exit code -1073741819 (0xC0000005) pycharm报错:Process finished with exit code - ...

  8. TENSORFLOW PROCESS FINISHED WITH EXIT CODE -1073741819 (0XC0000005)

    这次报错与是否gpu没有关系: TENSORFLOW 导入失败:PROCESS FINISHED WITH EXIT CODE -1073741819 (0XC0000005) 测试脚本: impor ...

  9. Pycharm debug出现Qt 错误 Process finished with exit code -1073741819 (0xC0000005)

    使用pycharm debug的时候出现 This application failed to start because it could not find or load the Qt platf ...

最新文章

  1. CommonJS规范与AMD规范的理解
  2. mysql5.5.42指定数据库同步操作
  3. 《转》VMware vSphere 5.1 学习系列之四:安装 SQL Server 数据库
  4. Java实现二分法(折半)查找数组中的元素
  5. SpringMVC学习08之SSM整合(三)
  6. App5.0程序导入及发布
  7. linux应用之----进程控制理论
  8. Python从键盘输入多行文本数据的方法
  9. jmap, jhat, jvisualvm:java堆内存对象分析利器
  10. 指令系统——数据寻址(1)(详解)
  11. 辰皇怎么过鸿蒙,诛仙3职业全面解析 各职业副本优缺点介绍
  12. Jquery技巧:使用ajax技术提交表单数据
  13. python自学要多久-python从入门到精通需要多久?你需要先明白这两个点
  14. 教师信息管理系统——c语言(附N-S图)
  15. win10锁屏账户和计算机名,如何隐藏Windows 10锁屏姓名及电子邮件地址
  16. 怎样查询网站关键字的排名
  17. tempfile.mkstemp 详解
  18. 【技术贴】Realtek HD声卡下QQ语音话筒没声音解决办法
  19. win10系统还原和重装系统一样吗?win10系统还原怎么操作?
  20. Bitcion Core 目录说明、使用说明、bitcoin.conf 配置说明

热门文章

  1. 指针与引用有什么区别?
  2. 淘宝商品详情查询V1新版接口
  3. 东华oj-进阶题第87题-挤牛奶
  4. easyui SWFUpload
  5. 梦幻西游手游版找不到服务器,梦幻西游手游无法选择服务器怎么办 解决方法...
  6. Glide(二)Glide的with,load,into
  7. c语言红酒编程题,20道葡萄酒小测试题,你都做对了吗
  8. 香港服务器租用不得不警惕的潜规则
  9. 网络IO Socket
  10. java+ssh+mysql生鲜商城