Text document in folder

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
Specify the entire path for the file when you open it
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
Topic archived. No new replies allowed.