S
solartimba
Hi,
I am in another country, and I need to finish a program. But I do not
have any reference books. Can you tell me how to print this to a file
without ending the stream with an endl. Stated differently, I don't
want an endl after the last data point printed to the file.
I know this is a basic question, and I apologize.
******************************
void outFile()
{
ofstream outfile(outPath.c_str());
vector<cVocabulary>::iterator iterSer;
for(iterSer=series.begin(); iterSer!=series.end(); ++iterSer)
{
outfile << iterSer->returnVocabulary() << endl;
outfile << iterSer->returnVocType() << endl;
outfile << iterSer->returnDefinition() << endl;
outfile << iterSer->returnExample() << endl;
}
outfile.close();
}
I am in another country, and I need to finish a program. But I do not
have any reference books. Can you tell me how to print this to a file
without ending the stream with an endl. Stated differently, I don't
want an endl after the last data point printed to the file.
I know this is a basic question, and I apologize.
******************************
void outFile()
{
ofstream outfile(outPath.c_str());
vector<cVocabulary>::iterator iterSer;
for(iterSer=series.begin(); iterSer!=series.end(); ++iterSer)
{
outfile << iterSer->returnVocabulary() << endl;
outfile << iterSer->returnVocType() << endl;
outfile << iterSer->returnDefinition() << endl;
outfile << iterSer->returnExample() << endl;
}
outfile.close();
}