【发布时间】:2017-11-05 20:08:38
【问题描述】:
我有一个这种格式的代码:
srcSAXController control(input_filename.c_str());
std::string output_filename = input_filename;
output_filename = "c-" + output_filename.erase(input_filename.rfind(XML_STR));
std:: ofstream myfile(output_filename.c_str());
coverage_handler handler(i == MAIN_POS ? true : false, output_filename);
control.parse(&handler);
myfile.write((char *)&control, sizeof(control));
myfile.close();
我希望将对象“控制”的内容写入我的文件。如何修复上面的代码,使控件对象的内容写入文件。
【问题讨论】:
标签: c++ file-io ifstream ofstream