0
What's the difference between endl & \n ?
3 odpowiedzi
+ 3
'endl' means the end of the system of a cout.
'\n' write the next string/input on a new line(aka below the previous line) in the same system of a cout
+ 1
'\n' is just one special char (new line or line feed).
endl is new line, but depending on the system it may be only line feed '\n' or CR ('\r') and LF ('\n')
0
ending your cout statements with endl will flush the buffer and prevent weird output errors.