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())
{
cout << "
Could not open input.txt";
exit(1);
}
the problem is when I try to debug my app or run my app from inside eclipse it cannot find the input.txt file. When I run my app from the console it works fine and opens the file. I need to debug the app but can't because for some reason the eclipse ide cannot find the file.
Where should I put the file?
See Question&Answers more detail:os