Hey guys just wondering if there are two simple commands in c++ to create a file and clear a file of all its contents?
Thanks.
Printable View
Hey guys just wondering if there are two simple commands in c++ to create a file and clear a file of all its contents?
Thanks.
look up ofstream. you should be able to figure it out from there
Why do you need a C++ command? I just use all the fopen(), fgets(), etc.
Thanks for the advice guys, after looking up ofstream I have found out that the old style header fstream.h creates the file and using ios:: out clears the file.
do not use fstream.h. use <fstream>
I beginning to think this should be in 20pt flashing font on the top of every page on this site :D