Text document in folder

Jul 21, 2010 at 9:22am
Hi, I am new to programming and trying to read/write to a text document, that is within a seperate folder.

I have no idea what the code is for this, and would really appreciate any help!

eg.

exe/c++ folder is on desktop
example.txt is within a folder on the desktop called example

How can I get the program to find and open the text document, as normally the text document must be in the same folder to work.


Thanks

Matt
Jul 21, 2010 at 9:24am
Specify the entire path for the file when you open it
Jul 21, 2010 at 9:26am
Thanks!, I will give that a go now

EDIT: Tried it, couldnt get it working

ifstream in("example.txt");

^ that is what i normally use.

Any suggestions?
Last edited on Jul 21, 2010 at 9:28am
Topic archived. No new replies allowed.