首页 > 编程语言 > 详细

C++ clear data in text file

时间:2020-01-21 11:08:28      阅读:86      评论:0      收藏:0      [点我收藏+]

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();

C++ clear data in text file

原文:https://www.cnblogs.com/jieliujas/p/12220895.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!