segmentation fault : 11

后端 未结 4 529
甜味超标
甜味超标 2021-01-31 01:40

I\'m having a problem with some program, I have searched about segmentation faults, by I don\'t understand them quite well, the only thing I know is that presumably I am trying

4条回答
  •  余生分开走
    2021-01-31 02:29

    What system are you running on? Do you have access to some sort of debugger (gdb, visual studio's debugger, etc.)?

    That would give us valuable information, like the line of code where the program crashes... Also, the amount of memory may be prohibitive.

    Additionally, may I recommend that you replace the numeric limits by named definitions?

    As such:

    #define DIM1_SZ 1000
    #define DIM2_SZ 1000000
    

    Use those whenever you wish to refer to the array dimension limits. It will help avoid typing errors.

提交回复
热议问题