cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
question
question
Jul 24, 2012 at 6:36pm UTC
nanadien
(5)
how do you open a file whose name contains a backslash, such as:
temp\output.dat
or
c:\temp\output.dat
Jul 24, 2012 at 6:48pm UTC
Disch
(13742)
Use a forward slash.
IE:
"C:/temp/output.dat"
.
Jul 24, 2012 at 6:56pm UTC
nanadien
(5)
ok,but can i use it like this-the name as a directory- in the fstream function when i call it?
Jul 24, 2012 at 8:13pm UTC
Disch
(13742)
Yes.
fstream myfile(
"C:/path/to/your/file/filename.txt"
);
Topic archived. No new replies allowed.