Segmentation fault when calling fgets

后端 未结 2 523
轮回少年
轮回少年 2021-01-22 17:46

I\'m trying to write a simple program to read data from files listed in a plain text list, but I keep running into a segmentation fault when I try to call fgets() in my processF

2条回答
  •  隐瞒了意图╮
    2021-01-22 18:25

    Try checking return value of fopen. What if it's NULL? Because it is likely that your "file name" has trailing \n.

提交回复
热议问题