c++ - how to access a text file while debugging with eclipse CDT -
I am writing this code to access a file in Eclipse CDT
Ifstream inFile; Offream outfile; Next string; InFile.open ("input.txt"); If (inFile.fail ()) {cout & lt; & Lt; "The input \" txt can not be opened "; Exit (1);} The problem is that when I try to debug my app or my If the app goes from the inside of the eclipse, then this input. When I run my app from the console it works fine and the file opens, I have to debug the app, but this can not happen because because of some reason the eclipse id The file can not be found.
Where do I want to keep the file A?
This could be an issue with relative paths. Code> input.txt ? The eclipse creates a top-level directory of the work directory if you change the "input.txt" in your code to a fully qualified filename , Then it should also work.
Comments
Post a Comment