Unable to open a file with fopen()

后端 未结 8 978
盖世英雄少女心
盖世英雄少女心 2020-12-03 18:21

I\'ve been trying to open a file and output text, but I keep getting errors. So I thought I would start at the very beginning and just try opening the file. This is my cod

8条回答
  •  -上瘾入骨i
    2020-12-03 18:51

    A little error checking goes a long way -- you can always test the value of errno or call perror() or strerror() to get more information about why the fopen() call failed.

    Otherwise the suggestions about checking the path are probably correct... most likely you're not in the directory you think you are from the IDE and don't have the permissions you expect.

提交回复
热议问题