September 16th, 2003, 11:28 AM
Easy Question C++ 5.0
He is an easy one for yall, but because I am a newbee I don't know how to do it.
I know you can remove a file by simply saying remove("file.ext")
the question is how do you create a file
I tried create("file.ext") that did not work
just wondering. Thanks for the help
September 16th, 2003, 11:46 AM
Open it for write access, and close it.
September 16th, 2003, 11:53 AM
Here is my code. It does not create the file out.txt
Thanks for the help
No replies found.
September 16th, 2003, 12:10 PM
Here fstream f(.. itself will create the file. f(.. is the constructor. This will create the file
The other way for this is to use f.open(...
September 16th, 2003, 12:46 PM
Thanks for th ereply
when I input your code I get this error
error C2226: syntax error : unexpected type 'ios'
I put the exact code in (with out the face)
fstream f("hai.txt",ios: out);
Is that what you had?
By the way I am running on C++ 5.0
September 16th, 2003, 12:52 PM
Forums and ofcourse my error. I have not disabled the smilies ;)
fstream f("hai.txt",ios:: out);
September 16th, 2003, 01:17 PM
Ahhh, it works. You are the man,...or woman.
Anyways thanks so much for the help. I can now continue. Thanks again