mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-24 01:51:38 +00:00
Add more escape sequences to C.
This commit is contained in:
parent
8caf3768fb
commit
411d9a9813
@ -21,14 +21,21 @@ Multi-line comments look like this. They work in C89 as well.
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
//Special characters:
|
//Special characters:
|
||||||
|
'\a' // alert (bell) character
|
||||||
'\n' // newline character
|
'\n' // newline character
|
||||||
'\t' // tab character (left justifies text)
|
'\t' // tab character (left justifies text)
|
||||||
'\v' // vertical tab
|
'\v' // vertical tab
|
||||||
'\f' // new page
|
'\f' // new page (formfeed)
|
||||||
'\r' // carriage return
|
'\r' // carriage return
|
||||||
'\b' // backspace character
|
'\b' // backspace character
|
||||||
'\0' // null character. Usually put at end of strings in C lang.
|
'\0' // null character. Usually put at end of strings in C lang.
|
||||||
// hello\n\0. \0 used by convention to mark end of string.
|
// hello\n\0. \0 used by convention to mark end of string.
|
||||||
|
'\\' // backspace
|
||||||
|
'\?' // question mark
|
||||||
|
'\'' // single quote
|
||||||
|
'\"' // double quote
|
||||||
|
'\xhh' // hexadecimal number. Example: '\xb' = vertical tab character
|
||||||
|
'\ooo' // octal number. Example: '\013' = vertical tab character
|
||||||
|
|
||||||
//print formatting:
|
//print formatting:
|
||||||
"%d" // integer
|
"%d" // integer
|
||||||
|
Loading…
Reference in New Issue
Block a user