1. 程式人生 > >c++文件流寫入到execl中

c++文件流寫入到execl中

int clu c++ fstream sin name pac ofstream ()

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

  

c++文件流寫入到execl中