Ifstream file does not open although everything seems in place (c++)

后端 未结 1 1933
清歌不尽
清歌不尽 2021-01-07 10:08

I\'m trying to write a program to parse the first and sixteenth columns of a CSV file (converted into .txt). I have the CSV (\"posts.txt\") document in the folder with the e

相关标签:
1条回答
  • 2021-01-07 10:37

    I have the CSV ("posts.txt") document in the folder with the executable.

    The file should be present in the current working directory of your process, which may or may not be the same directory where the executable lives. If in doubt, try specifying the full path in ifstream inFile(...); to see whether that changes things.

    Additionally, the file needs to have the correct permissions to ensure that it's readable by the process.

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