How to use fstream objects with relative path?

前端 未结 7 1920
终归单人心
终归单人心 2020-12-03 02:53

Do I always have to specify absolute path for objects instantiated from std::fstream class? In other words, is there a way to specify just relative path to them

7条回答
  •  Happy的楠姐
    2020-12-03 03:23

    You can specify a path relative to current directory. On Windows you may call GetCurrentDirectory to retrieve current directory or call SetCurrentDirectory to set current directory. There are also some CRT functions available.

提交回复
热议问题