Escape Sequences
(这篇随笔是 C++ Primer 5th ed. pp.39-40的摘录)
Some characters, such as backspace or control characters, have no visible image. Such characters are non printable.
Other characters (single and double quotation marks, question marks, and backlash) have special meaning in the language. Our programs cannot use any of these characters directly. Indeed, we use an escape sequence to represent such characters. An escape sequence begins with a backslash ('\'). The language defines several escape sequences:
newline \ horizontal tab \t alert (bell) \a
vertical tab \v backspace \b double quote \"
backslash \\ question mark \? single quote \'
carriage return \r formfeed \f
----------------------------------------------------------------------------------------------------------------------------
We can also write a generalized escape sequence, which is \x followed by one or more hexadecimal digits or a \
followed by one, two, or three octal digits. The value represents the numerical value of the character.
Note that if a \ is followed by more than three octal digits, only the first three are associated with the \. In contrast, \x uses up all the hex digits following it.
Ordinarily, haxadecimal characters with more than 8 bits are used with extended characters sets using one of the following prefixs:
Prefix Meaning Type
u Unicode 16 character char16_t
U Unicode 32 character char32_t
L wide character wchar_t
u8 utf-8 (string literals only) char
--------------------------------------------------------------------------------------------------------------------------
Escape Sequences的更多相关文章
- python escape sequences
转义字符 描述 \(在行尾时) 续行符 \\ 反斜杠符号 \' 单引号 \" 双引号 \a 响铃 \b 退格(Backspace) \e 转义 \000 空 \n 换行 \v 纵向制表符 \ ...
- Escape Sequences in String
Code Output \' single quote \" double quote \\ backslash \n newline \r carriage return \t tab ...
- escape(), encodeURI()和encodeURIComponent()(转)
escape(), encodeURI()和encodeURIComponent()是在Javascript中用于编码字符串的三个常用的方法,而他们之间的异同却困扰了很多的Javascript初学 ...
- 关于 escape、encodeURI、encodeURIComponent
参考资料:http://hi.baidu.com/flondon/item/983b3af35b83fa13ce9f3291 http://www.w3school.com.cn/js/jsref ...
- 比较escape、encodeURI、encodeURIComponent
估计很多前端工程师并不清楚escape,encodeURI, encodeURIComponent的区别,也不知道什么时候该用哪个方法,以及这些方法为什么要被用到,下面我主要来阐述一下这三个方法的区别 ...
- ANSI escape code
最近在做iOS上的SSH终端项目,主要是在手机上远程连接Unix系统,并进行一些简单的指令操作,类似于SecureCRT:今天想总结一下这个项目中遇到的新东西----ANSI escape code. ...
- 关于JavaScript中的escape、encodeURI和encodeURIComponent
此文内容与关于JavaScript中的编码和解码函数 关联 escape() 方法: 采用ISO Latin字符集对指定的字符串进行编码.所有的空格符.标点符号.特殊字符以及其他非ASCII字符都将被 ...
- 转载:escape,encodeURI,encodeURIComponent有什么区别?
escape unescape encodeURI decodeURI encodeURIComponent decodeURIComponent 这六个方法功能有关联,如果不清楚每一个的作用,很容易 ...
- 使用escape、encodeURI 和 encodeURIComponent 解决url中文乱码问题
escape(), encodeURI()和encodeURIComponent()是在Javascript中用于编码字符串的三个常用的方法,而他们之间的异同却困扰了很多的Javascript初学者, ...
随机推荐
- js原生捕鱼达人(一)
捕鱼达人的游戏大家都很熟悉吧,接下来的两三天,我会将整个游戏的原生js写法详细的写出来,整个游戏应用了面向对象的写法:创建构造函数,在构造函数上面添加对象的属性,然后在构造函数的原型上添加方法,当然这 ...
- C++中的运算符重载
首先思考以下几个问题: 1.什么是运算符重载? 2.为什么要重载运算符,它有什么用? 3.可以重载哪些运算符? 4.重载运算符有哪些规则? 一.基本概念 我们在程序中使用各种操作符,比如加(+).赋值 ...
- wireshark添加ip.id字段
wireshark添加ip.id字段 为了在多个设备上追踪同一个数据包. 如果是同一个会话,则可以计算延迟, 如sta和应用服务器慢,这种问题,可以根据这个加上ip.id追踪数据到哪里慢了.
- Redis做消息队列文章两篇
介绍:http://www.cnblogs.com/lhfcws/p/3732535.html 具体做法:http://shift-alt-ctrl.iteye.com/blog/1867454 另外 ...
- sqlalchemy 的 ORM 与 Core 混合方式使用示例
知乎: sqlalchemy 的 ORM 与 Core 混合方式操作数据库是一种怎样的体验? 答: 酸! 本文基于:win 10 + python 3.4 + sqlalchemy 1.0.13 基本 ...
- 基于Flot可放缩的折线图
Flot初步 Flot是一个免费开源的图标插件,可以用它开发出功能强大的图表系统.下面着重讲解在Asp.net中如何使用这个插件做出功能强大的图表应用. 关于Flot,可以在这里查看现有的例子(或者是 ...
- 在opencv3中实现机器学习之:利用逻辑斯谛回归(logistic regression)分类
logistic regression,注意这个单词logistic ,并不是逻辑(logic)的意思,音译过来应该是逻辑斯谛回归,或者直接叫logistic回归,并不是什么逻辑回归.大部分人都叫成逻 ...
- ActionBar在Android2.x的实现,类似新版微信界面。
ActionBar完美兼容Android4.x的机型,虽然现在Android2.x的系统越来越少,还有有一部分人使用的仍是2.x的系统,所以我们还得考虑着兼容性问题. 对比图: Test例子与微信的对 ...
- 优化Hibernate所鼓励的7大措施
优化Hibernate所鼓励的7大措施: 1.尽量使用many-to-one,避免使用单项one-to-many2.灵活使用单向one-to-many3.不用一对一,使用多对一代替一对一4.配置对象缓 ...
- 一起用HTML5 canvas做一个简单又骚气的粒子引擎
前言 好吧,说是"粒子引擎"还是大言不惭而标题党了,离真正的粒子引擎还有点远.废话少说,先看demo 本文将教会你做一个简单的canvas粒子制造器(下称引擎). 世界观 这个简单 ...