I\'m writing a program on a Linux platform that is generating text files that will be viewed on, inevitably, a Windows platform.
Right now, passing std::endl
std::endl
std::endl is basicly:
std::cout << "\n" << std::flush;
So just use "\r\n" instead and omit the flush. It's faster that way, too!
"\r\n"
From the ostream header file on endl:
This manipulator is often mistakenly used when a simple newline is desired, leading to poor buffering performance.