On Monday 03 April 2006 17:18, Jerry Feldman wrote:
I've seen a number of documents and code that prefers to use the newline character ("\n" or '\n') rather than std::endl In the general case, the issue is that endl forces a buffer flush where '\n' does not, and therefore using the newline is more efficient. However, using endl is more portable. Either way works fine on Linux. Comments...
It's not only portability, it's also about buffer flushing: http://gcc.gnu.org/onlinedocs/libstdc++/27_io/howto.html#2 OTOH this might be a reason to advise against std::endl, too: http://llvm.org/docs/CodingStandards.html#hl_avoidendl CU -- Stefan Hundhammer <sh@suse.de> Penguin by conviction. YaST2 Development SUSE Linux Products GmbH Nuernberg, Germany