M
mary
When we use
string line;
while (getline(in,line))
{
out.write(line.c_str(),line.size());
out.put('\n');
}
in.close();
out.close();
we are adding an empty line at the end of the file associated with
the stream "out". The same thing happens if we only use
out << line << endl;
to write into the file for "out".
How do we avoid that last empty line?
Thanks!
mary
string line;
while (getline(in,line))
{
out.write(line.c_str(),line.size());
out.put('\n');
}
in.close();
out.close();
we are adding an empty line at the end of the file associated with
the stream "out". The same thing happens if we only use
out << line << endl;
to write into the file for "out".
How do we avoid that last empty line?
Thanks!
mary