Main Gestures Programming Music Whoizzy? Links

C Programming

Part 1
Escape Characters

Escape characters to be used with printf() . . .


\n = Newline
\t = Horizontal Tab
\r = Carriage return (Brings the curser to the begginning of the current line)
\a = BELL DING!!!
\" = "
When using the escape character \n, anywhere you place this will result in a new line (this idea holds true for any escape character). Thus ...

printf("H\nE\nL\nL\nO\n");

would show up as the word 'HELLO', except each letter would be on a seperate line:

H
E
L
L
O

Pretty cool huh? Another thing are numbers and the %d format specifier.

printf("%d %d %d %d", 10, 9, 8, 7);

This would show the numbers on the screen as follows:

10 9 8 7

You could place a \n anywhere between the %d's and a line break would occur between the numbers. Get it?


Input And Output
C Menu

Found a broken link?
Mail Me