

56·
5 months agoIf you write to a text (as opposed to binary) stream, \n produces \n or \r\n (or \r if old enough) depending on platform just fine.
Nobody should be using C++ anyway, but plenty of languages have silly system newline constants, which do nothing useful.
And what happens when you run that on Feb 29, 2024?