Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C/C++ 中的\n, \t, \r #5

Open
zhirui1994 opened this issue Jan 17, 2019 · 0 comments
Open

C/C++ 中的\n, \t, \r #5

zhirui1994 opened this issue Jan 17, 2019 · 0 comments
Labels
Milestone

Comments

@zhirui1994
Copy link
Owner

起因

看c/c++代码时经常在字符串中看到\n, \t, \r这几个字符。刚开始不是很懂。

解释

这些都是转义字符
一般常用的如下表:

转义字符 意义 ASCII码值(十进制)
\a 响铃(BEL) 007
\b 退格(BS) 008
\f 换页(FF) 012
\n 换行(LF) 010
\r 回车(CR) 013
\t 水平制表(HT) 009
\v 垂直制表(VT) 011
\\ 反斜杠 092
' 单引号字符 039
" 双引号字符 034
\0 空字符(NULL) 000
\ddd 任意字符 三位八进制
\xhh 任意字符 二位十六进制
@zhirui1994 zhirui1994 added this to the 技术 milestone Jan 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant