Hi i want to save multiply lines in a string. I got a string logstring and i want to save multiplay error logs which i later can print in a txt file or as a console output.
std::endl isn't only a \n
(newline) character, but it also flushes the stream.
If you have a file open in 'text-mode', your operating system should replace \n
with the correct platform specific end of line character(sequence). So simply appending a \n
should be fine. Portable end of line (newline)
Also note that by default, standard input and output are opened in textmode with msvc.