Line 55: Char 44: runtime error: store to address 0x625000318040 with insufficient space for an object of type 'int *' (solution.c)


  1. 关注代码逻辑,是否死循环(但是这个在简单的示例中就能发现)
  2. 前期申请空间太多,合理安排内存申请
    // int **returnArr = (int **)malloc(sizeof(int *) * 1000);
    // *returnColumnSizes = (int *)malloc(sizeof(int) * 1000);
    int **returnArr = (int **)malloc(sizeof(int *) * (numsSize + 1) * 6);
    *returnColumnSizes = (int *)malloc(sizeof(int) * (numsSize + 1) * 6);

3.注意释放内存
/**

  • Return an array of arrays of size *returnSize.
  • The sizes of the arrays are returned as *returnColumnSizes array.
  • Note: Both returned array and *columnSizes array must be malloced, assume caller calls free().
    */


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM