Where to place file in order to read?

前端 未结 4 491
小鲜肉
小鲜肉 2021-01-20 01:20

Hey, where do I place a text file that I\'m trying to read using fstream? In this tutorial, http://www.gamedev.net/reference/articles/article1127.asp, they say

ifstr

4条回答
  •  失恋的感觉
    2021-01-20 02:13

    It depends on your system, but in most cases, if you open a file with a relative path, it will find the file relative to the working directory of the process (i.e., relative to the location from which you started the program).

    So, if you simply try to open "input.txt" it will likely look in the directory from which you started the program.

提交回复
热议问题