View Single Post
Old 02-10-2012, 10:59 AM   #5062
Sauer Grapes
Snatchin' yo people up
 
Sauer Grapes's Avatar
1
 
Join Date: Oct 2008
Posts: 2,235
Trading: (44)
Cohiba
Sauer Grapes has disabled reputation
Default Re: Funny Pics thread

Quote:
Originally Posted by Mattso3000 View Post
Love this.
Quote:
Originally Posted by markem View Post
Indeed. Left out the "\n" carriage return/line feed at the end of the quoted string. I'd mark it down too.
Quote:
Originally Posted by fencefixer View Post
Carriage Return: CR \r 0x0D decimal 13
Line Feed: LF \n 0x0a decimal 10

Quote:
Originally Posted by markem View Post
"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).

Suddenly the picture doesn't seem funny anymore.
Sauer Grapes is offline