Is std :: endl OS dependent?
Possible duplicate:
What does std :: endl mean exactly on each platform?
I'm trying to figure out if std :: endl will return \r\n
, \n
or \r
depending on the platform, or if it stays alone all the time.
source to share
'\ n' Outputs a newline (in the appropriate platform-specific representation, so it generates "\ r \ n" on Windows). std :: endl does the same and dumps it.
Use '\ n' instead of std :: endl; when trying to output a newline, but use std::endl
when trying to dump it. Unnecessary cleanup slows down the performance of your application as we all know that file i / o is one of the slowest operations besides user I / O.
source to share