当前位置:网站首页>Summary of whitespace, space and escape characters in C language
Summary of whitespace, space and escape characters in C language
2022-08-10 10:04:00 【An Ran_】
1. What are whitespace, space, and escape characters?
(1) Space characters, tabs, newlines, etc. are collectively referred to as whitespace.
(2) Space character, not equivalent to The
key on the keyboard does not exist on the keyboard. It is not a space, but it can play the effect of a space and occupy a character position.(3) Escape character, all ASCII code can be represented by "\" plus a number (usually an octal number).And C defines some letters before adding "\" to indicate common ones that cannot be displayedASCII characters, such as \0,\t,\n, etc., are called escape characters, because the following character is not its original ASCII character meaning.
Two, related extension
①Whitespace is only used in character constants and string constant works. When it appears in other places, it only plays the role of interval. CompileThe program ignores them.Therefore, the use of whitespace in the program does not affect the compiled program, but the use of whitespace in the program appropriate places will increase the clarity and feasibility of the program.readability.
②
Chinese name space character
Input method Use the system's own characterEnter function, enter notepad——Hold Alt + Numpad, enter 127 in turn, and release the Alt key after typing
③All escape characters and their corresponding meanings:
The ones in bold are the ones I use a lot when I do exercises at present
Escape character
Meaning
ASCII value (decimal)
\a
Bell (BEL)
007
\b
Backspace (BS), move the current position to the previous column
008
\f
Form feed (FF), move the current position to the beginning of the next page
012
\n
Line feed (LF), move the current position to the beginning of the next line
td>010
\r
Carriage Return (CR), move the current position to the beginning of the line
013
\t
Horizontal Tabulation (HT) (skip to next TAB position)
009
\v
Vertical Tabulation (VT)
011
\\
represents a backslash character ''\'
092
\'
represents a single quote (apostrophe) character
039
\"
represents a double quote character
034
\?
represents a question mark
063
\0
Null character (NUL)
000
\ddd
Any character represented by 1 to 3 octal digits
Octal with three digits
\xhh
Any character represented in hexadecimal
hex
3. Summary of topic points
1. The difference between space character and blank character
For example: when counting the number of various characters, is it ' ' or '\t', '\n', etc.
Note: Reference: Baidu Encyclopedia
边栏推荐
猜你喜欢
随机推荐
keepalived:常见问题
在“企业通讯录”的盲区,融云的边界与分寸
Array of shell scripts
CSDN21天学习挑战赛——多态(05)
jq封装树形下拉选择框组件
Oracle rac所在的网络要割接,停掉其中一个rac节点,这种方案可行吗?
【数据仓库】什么是 Azure Synapse,它与 Azure Data Bricks 有何不同?
裸辞→自我放松→闭关→复习→斩获Offer
Which is the strongest workflow engine for "Technology Selection"?Chief Architecture Helps You Pick
第三章 搜索与图论(三)
亚信AntDB数据库有啥业务应用场景和应用案例?
ESP8266 Tutorial 1 - Introduction to ESP8266 Hardware Platform
LeetCode Algorithm 914. 卡牌分组
腾讯发布四足机器人 Max 二代版本,梅花桩上完成跳跃、空翻
ELK框架搭建[通俗易懂]
The Generation of Matlab Symbolic Functions and the Calculation of Its Function Values
ES复杂操作搜索
Singleton pattern base class
LCD DRM component 框架分析
数据中台解决方案及未来发展方向