SyntaxFix
Write A Post
Hire A Developer
Questions
If you simply open the file for writing with the truncate-option, you'll delete the content.
std::ofstream ofs; ofs.open("test.txt", std::ofstream::out | std::ofstream::trunc); ofs.close();
http://www.cplusplus.com/reference/fstream/ofstream/open/