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.
Don't forget std::endl adds a new line and flushes the buffer.
std::endl
If you simply want new lines, \n, add them to your string, using + or stream them to a stream, using << '\n'.
\n
+
<< '\n'
For example,
std::string logstring; logstring = logstring + "Error Message" + "Number" + "Time + Date"; logstring += '\n';