Answers for "c++ overwrite file"

C++
0

c++ overwrite file

#include <fstream>

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

   ofs << "lorem ipsum";

   ofs.close();
}
Posted by: Guest on September-07-2021

Browse Popular Code Answers by Language