File Creation Location Trouble

I made a file and tried to change it but the program made another file instead. I was wondering how to specify the file path, or even if there is a way.
Can you post the code you used?
It's not a problem I just don't know how to specify a file path for where the file I want it to read is.
You use it when you create an i/o/fstream object.

http://www.cplusplus.com/reference/iostream/fstream/fstream/
http://www.cplusplus.com/reference/iostream/fstream/open/

If you show me your code I can more specifically show you where to put the file path.
Last edited on
How do you specify a file path like:
c:\user\owner\desktop\projects\test.txt
In your program when you state the name of the file that you want to save, just add the directory:
1
2
3
fstream file;
file.open("C:/user/owner/desktop/projects/text.txt", ios::out);
//save information 
THANK YOU SO MUCH!!!!!!!!!!!!!!
Topic archived. No new replies allowed.