Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

c++ overwrite file

#include <fstream>

int main ()
{
   std::ofstream ofs("test.txt", std::ofstream::trunc);

   ofs << "lorem ipsum";

   ofs.close();
}
Source by www.cplusplus.com #
 
PREVIOUS NEXT
Tagged: #overwrite #file
ADD COMMENT
Topic
Name
7+4 =