用C++向一个txt文档中写数据

bool CMaked::WriteFileMake(CString filePath, const char *isChange)
{
	ofstream file;
        //filePath为该txt文档的全路径
	file.open(filePath, ios::out);//以写的方式打开,没有会创建
	if (file.is_open())
	{
		file << isChange << endl;
		file.close();
		return true;
	}
	return false;
}

  以上需要包含的头文件:#include <fstream>

 

posted on 2015-12-23 15:45  !!-阳光-!!  阅读(1531)  评论(0编辑  收藏  举报

导航