• Digital Mark@lemmy.sdf.org
    link
    fedilink
    English
    arrow-up
    5
    ·
    9 months ago

    If 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.