Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ifstreamでファイルを開くのに問題があります
私が行った場合:
ifstream myfile; myfile.open("C:/Users/build/windows/Debug/map1.xml");
正常に動作しますが、相対パスを実行すると(実行可能ファイルはDebug /にあります)
ifstream myfile; myfile.open("map1.xml");
ファイルは見つかりません。何か助けはありますか?私は愚かな何かを逃していますか?
ほとんどの場合、IDEは、起動時にプログラムの作業ディレクトリを変更します。入れてみてmap1.xmlくださいc:\users\build\windows
map1.xml
c:\users\build\windows