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.
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
"I saw a sign that said 'Drink Canada Dry', so I started"
-- Brendan Behan
Free Compiler: Visual C++ 2005 Express
If you program in C++, you need Boost. You should also know how to use the Standard Library (STL). Want to make games? After reading this, I don't like WxWidgets anymore. Want to add some scripting to your App?
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
"I saw a sign that said 'Drink Canada Dry', so I started"
-- Brendan Behan
Free Compiler: Visual C++ 2005 Express
If you program in C++, you need Boost. You should also know how to use the Standard Library (STL). Want to make games? After reading this, I don't like WxWidgets anymore. Want to add some scripting to your App?