-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathescape_sequences.html
More file actions
169 lines (127 loc) · 3.73 KB
/
escape_sequences.html
File metadata and controls
169 lines (127 loc) · 3.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<!-- Mirrored from cppreference.com/escape_sequences.html by HTTrack Website Copier/3.x [XR&CO'2004], Tue, 22 Jan 2008 06:22:09 GMT -->
<!-- Added by HTTrack --><meta http-equiv="content-type" content="text/html;charset=iso-8859-1"><!-- /Added by HTTrack -->
<head>
<meta name="generator" content=
"HTML Tidy for Linux/x86 (vers 1 September 2005), see www.w3.org">
<title>Escape Sequences</title>
<link href="cppreference.css" rel="stylesheet" type="text/css">
<link href="prettify.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="prettify.js"></script>
</head>
<body onload="prettyPrint()">
<table>
<tr>
<td valign="top">
<div class="body-content">
<div class="header-box">
<a href="index-2.html">cppreference.com</a> > Escape Sequences
</div>
<h3>Constant Escape Sequences</h3>
<p>The following escape sequences can be used to define certain
special characters within strings:</p>
<table class="misc-table">
<tr>
<th>Escape Sequence</th>
<th>Description</th>
</tr>
<tr class="misc-table-tr-2">
<td>\'</td>
<td>Single quote</td>
</tr>
<tr class="misc-table-tr-1">
<td>\"</td>
<td>Double quote</td>
</tr>
<tr class="misc-table-tr-2">
<td>\\</td>
<td>Backslash</td>
</tr>
<tr class="misc-table-tr-1">
<td>\nnn</td>
<td>Octal number (nnn)</td>
</tr>
<tr class="misc-table-tr-2">
<td>\0</td>
<td>Null character (really just the octal number zero)</td>
</tr>
<tr class="misc-table-tr-1">
<td>\a</td>
<td>Audible bell</td>
</tr>
<tr class="misc-table-tr-2">
<td>\b</td>
<td>Backspace</td>
</tr>
<tr class="misc-table-tr-1">
<td>\f</td>
<td>Formfeed</td>
</tr>
<tr class="misc-table-tr-2">
<td>\n</td>
<td>Newline</td>
</tr>
<tr class="misc-table-tr-1">
<td>\r</td>
<td>Carriage return</td>
</tr>
<tr class="misc-table-tr-2">
<td>\t</td>
<td>Horizontal tab</td>
</tr>
<tr class="misc-table-tr-1">
<td>\v</td>
<td>Vertical tab</td>
</tr>
<tr class="misc-table-tr-2">
<td>\xnnn</td>
<td>Hexadecimal number (nnn)</td>
</tr>
</table>
<p>An example of this is contained in the following code (which
assumes that the newline character generates complete newlines,
i.e. on Unix systems):</p>
<pre class="prettyprint">
printf( "This\nis\na\ntest\n\nShe said, \"How are you?\"\n" );
</pre>
<p>which would display</p>
<pre class="prettyprint">
This
is
a
test
She said, "How are you?"
</pre>
</div>
</td>
<td width="120" valign="top">
<script type="text/javascript"><!--
google_ad_client = "pub-6243170425937584";
google_ad_width = 120;
google_ad_height = 600;
google_ad_format = "120x600_as";
google_ad_type = "text";
google_ad_channel ="";
google_color_border = "EEEEFF";
google_color_bg = "FFFFFF";
google_color_link = "000000";
google_color_url = "336699html.html";
google_color_text = "333333";
//--></script>
<script type="text/javascript"
src="../pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</td>
<script src="../www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-2828341-1";
urchinTracker();
</script>
</tr>
</table>
</body>
<!-- Mirrored from cppreference.com/escape_sequences.html by HTTrack Website Copier/3.x [XR&CO'2004], Tue, 22 Jan 2008 06:22:09 GMT -->
<!-- Added by HTTrack --><meta http-equiv="content-type" content="text/html;charset=iso-8859-1"><!-- /Added by HTTrack -->
</html>