Segmentation Fault While Creating Large Arrays in C

前端 未结 2 1523
生来不讨喜
生来不讨喜 2020-11-28 17:02

you guys have helped me so much with this code. Let me preface by saying I do not know C very well and am trying really hard to do this.

This is what the program sho

2条回答
  •  一向
    一向 (楼主)
    2020-11-28 17:23

    Well there is no way you are going to have that amount of space available on the stack. Allocate it off the heap using malloc(). Remember to free() it afterwards.

提交回复
热议问题