c++文件流写入到execl中

Posted on 2018-07-05 23:53  禾小白  阅读(162)  评论(0编辑  收藏  举报
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main()
{
	ofstream oFile;
	oFile.open("test.csv",ios::out|ios::trunc);
	oFile<<"属性1"<<","<<"属性2"<<","<<"结果1"<<","<<"结果2"<<endl;
	oFile<<"010101"<<","<<"1 2 3"<<","<<"32.2 112.3;23.12 23.22;23.14 23.45"<<","<<"1"<<endl;
	oFile.close();
}