Opening file in Microsoft VS 2010

I am using Microsoft Visual Studio 2010 on Windows 7. I am making a console app and I am trying to open a text file, "sample.txt", from the project folder. When I type infile.open("sample.txt"); it is not working. I have to specify the entire path. Whenever I used Code::Blocks and dev-C++ before that, the compiler automatically checked the project folder. Does that not work in VS?
Last edited on
Do you have the file in
Documents\Visual Studio 2010\Projects\<project_name>\<project_name>\
?
Thanks naruku, I was looking in the folder where the solution was located, not where the actual .cpp file was.
Last edited on
Topic archived. No new replies allowed.