how to access a text file while debugging with eclipse CDT

前端 未结 5 1804
刺人心
刺人心 2020-12-21 04:16

I am writing this code to access a file in eclipse CDT

ifstream inFile;
ofstream outFile;
string next;

inFile.open(\"input.txt\");
if (inFile.fail())
{
             


        
5条回答
  •  臣服心动
    2020-12-21 04:43

    Write a test program that creates file, such as "Here_I_Am.txt".

    The directory where this is found will be the directory that the executable is using as the default directory.

    Add paths to your filename as appropriate, relative to the "Here_I_Am.txt" file. Or put your text file in the same directory as "Here_I_Am.txt"

提交回复
热议问题