Segmentation Fault - Large Array

前端 未结 1 1641

I am having an odd error when I try to compile my code, which is written in C. The error says

 segmentation fault (core dumped)

In my code,

相关标签:
1条回答
  • You've encountered a "Stack Overflow"; basically, you've exhausted the stack space available to your program.

    If you allocate the arrays on the heap (in heap storage), you probably will be okay.

    With C, you'd likely use the malloc instruction to allocate the memory.

    And of course, you'll remember to use the free instruction to return the memory when you're done with it.

    0 讨论(0)
提交回复
热议问题