std::ifstream File;
std::string filepath = "text.txt";
File.open(filepath.c_str(), std::ifstream::out | std::ifstream::trunc );
if (!File.is_open() || File.fail())
{
File.close();
printf("\nError : failed to erase file content !");
}
File.close();

相关文章:

  • 2022-12-23
  • 2022-03-02
  • 2021-10-11
  • 2022-12-23
  • 2021-12-06
  • 2021-12-22
  • 2022-12-23
  • 2021-05-20
猜你喜欢
  • 2021-06-09
  • 2022-01-09
  • 2022-03-04
  • 2021-12-01
  • 2021-09-10
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案