常见的文本文件格式输出方法如下
char * File2 = "norms.txt";
ofstream outfile2(File2);
outfile2 << endl;
vector<int>PointNormals;
int jj = 0;
while (jj < PointNormals.size()){
outfile2 << setiosflags(ios::fixed)<<setw(20)<<PointNormals[jj]<< " ";
if (!((jj + 1) % 3))
{
outfile2 << endl;
}
jj++;
}
PointNormals.resize(0);
outfile2.close();
输入例子如下
ReadPoints_Resample(readMode _rm){
m_NumOfPoint = 0;
ifstream infile(filename,ios_base::in);
if (!infile)
{
return ;
}
m_Points.resize(WNUM);