From: greg@censoft.com (Greg Haerr)
Subject: [TUHS] Why is \n 012?
Date: Sat, 8 Mar 2003 19:57:31 -0800 [thread overview]
Message-ID: <040b01c2e5f0$03000580$6401a8c0@gregnewport> (raw)
In-Reply-To: <20030309032000.GD34634@wantadilla.lemis.com>
> A thing that has puzzled me almost for ever is why the newline
> character in C is 012 and not 015. Does anybody have any insight?
Well, my take on this is that C was developed with UNIX,
of course, and UNIX early on decided to use a single
character rather than a two-char (CRLF) sequence for
end-of-lines. So, since the CR was already in use for
the leading char in the two-char sequence, it made it a lot
easier to use the LF character for the single newline, so
programs wouldn't always have to be checking a second
character...
Regards,
Greg
next prev parent reply other threads:[~2003-03-09 3:57 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-03-09 3:20 Greg 'groggy' Lehey
2003-03-09 3:57 ` Greg Haerr [this message]
2003-03-09 6:19 ` M. Warner Losh
2003-03-09 6:07 Dennis Ritchie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='040b01c2e5f0$03000580$6401a8c0@gregnewport' \
--to=greg@censoft.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).