View Single Post
Old 02-10-2012, 10:54 AM   #5061
markem
Bunion
 
markem's Avatar
16
 
Join Date: Oct 2008
First Name: Mark
Location: Second Star on the Right
Posts: 22,598
Trading: (47)
HUpmann
markem has disabled reputation
Default Re: Funny Pics thread

Quote:
Originally Posted by fencefixer View Post
Carriage Return: CR \r 0x0D decimal 13
Line Feed: LF \n 0x0a decimal 10

"The sequence \n in the string is C notation for the newline character, which when printed advances the terminal to the left margin of the next line." (Kernighan and Ritchie, "The C Programming Language" 1978, p. 7.

As someone who used to write terminal device drivers, I can assure you that advancing to the left margin of the next line encompasses (conceptually if not in fact) a line feed (vertical offset) and carriage return (horizontal offset).

Don't try to outgeek the computer science professor on this particular score. ASCII value != C implementation (which can vary based on device driver and OS).

__________________
I refuse to belong to any organization that would have me as a member.
~ Groucho Marx
markem is offline