Computing.Net > Forums > Programming > writng files to folder in C++

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

writng files to folder in C++

Reply to Message Icon

Name: Jeff
Date: September 18, 2002 at 17:43:40 Pacific
OS: WindowsXP
CPU/Ram: not sure
Comment:

how do you specify where you save your files to in c++ when using fstream?



Sponsored Link
Ads by Google

Response Number 1
Name: Justin
Date: September 18, 2002 at 19:25:56 Pacific
Reply:

What I think you want to do is just open a new file at your specified folder and output to there. Make sure when assigning the file name to use the double backslash.

fstream OutFile("C:\\C_code\\myfolder\\output01.dat", ios::out);

I think that should do the trick.


0
Reply to Message Icon

Related Posts

See More


Cookie how do u do a beep sound ...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: writng files to folder in C++

read file from subroutine in c++ www.computing.net/answers/programming/read-file-from-subroutine-in-c/3714.html

how to programm in C++ (for null le www.computing.net/answers/programming/how-to-programm-in-c-for-null-le/12576.html

file handling function in 'C'. www.computing.net/answers/programming/file-handling-function-in-c/2119.html