Wednesday, August 13, 2008

Escape characters and printf

Escape Sequence Character represented
\n newline
\t tab
\\ backslash itself
\' quote ``'''
\" double quote ``"''
For example,

printf("\t\"My name is \'%s\'\"\n", "Jim");
Which prints

"My name is 'Jim'"

0 comments:

Post a Comment