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())
{
I found that with Eclipse, having the file in the root directory of the project should let it load. However, if you want to run it from the command line, the file needs to be in the same folder as the executable (something like Debug/ inside the project folder).
It should work to drag and drop the file into your Eclipse project. Just make sure that you select the option to Copy the file, rather than Link to it.