> For completeness the definitions of \n and \r in C are: > > "\n (new line) Moves the active position to the initial > position of the next line.
Hmm. If the output is to a terminal, and the OS is Unixy,
then to guarantee that behaviour, \n must generate both
a CR and an LF, not just an LF. Terminals can dynamically be
set in "raw" mode. Among other things, LF then stays LF,
and LF just moves one line down. In (default) "cooked" mode,
each LF is replaced by an LF and a CR (I don't recall the order)
by the tty driver.
But as far as I know, \n in C under Unixy systems just produce
an LF. And the compiler has no way of knowing at compile
time if the device will be in raw mode or "cooked" mode. So
producing just an LF for \n in C/Unix does not conform to
the C specification, since the output may be to a Unixy
terminal (or a Unixy lpr printer) in "raw" mode. Hmm...
/kent k
smime.p7s
Description: S/MIME cryptographic signature

