what character is a physical newline
Jerry McAllister
jerrymc at msu.edu
Mon Jun 29 15:14:02 UTC 2009
On Sun, Jun 28, 2009 at 10:38:20PM -0400, Vince Sabio wrote:
> ** At 22:30 -0400 on 06/28/2009, Glen Barber wrote:
> >On Sun, Jun 28, 2009 at 10:27 PM, Aryeh M. Friedman wrote:
> > >>
> >>> What do you mean exactly? What language(s)? If I understand your
> >>> question correctly, the C / C++ / Java / PHP (and I think Perl)
> > >> 'newline' character is '\n'
> > >
> >> I meant what ascii character does \n actual correspond to (I assume <CR>
> >> but
> > > just making sure)
>
> No, CR is a carriage return, which is a \r in C, and is an ASCII 13 (hex
> 0D).
>
> "Newline" is a line feed (LF), which is a \n in C, and is an ASCII 10 (hex
> 0A)
>
> >Oh. IIRC, CR is the DOS way, and LR is the POSIX way.
>
> Not exactly; CRLF is the DOS way, CR is the Macintosh way, and LF is
> Unix/Posix.
A quick Google search for ASCII came up with this page:
http://www.asciitable.com/
Which correctly lists Line Feed (LF) as: Decimal 10, Hex 0A, Octal 012
Carriage Return (CR) is: Decimal 13, Hex 0D, Octal 015
////jerry
>
> HTH.
>
> __________________________________________________________________________
> Vince Sabio vince at vjs.org
> _______________________________________________
> freebsd-questions at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe at freebsd.org"
More information about the freebsd-questions
mailing list