PageRenderTime 18ms CodeModel.GetById 12ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/www.cppreference.com/wiki/escape_sequences

https://github.com/tsgates/cclookup
#! | 104 lines | 98 code | 6 blank | 0 comment | 0 complexity | 7b845e44b8d69a76307a9820180de4ad MD5 | raw file
  1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
  4 lang="en" dir="ltr">
  5<head>
  6  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  7  <title>escape_sequences</title>
  8<meta name="generator" content="DokuWiki" />
  9<meta name="robots" content="index,follow" />
 10<meta name="date" content="2010-10-28T18:17:16-0700" />
 11<meta name="keywords" content="escape_sequences" />
 12<link rel="search" type="application/opensearchdescription+xml" href="http://www.cppreference.com/wiki/lib/exe/opensearch.php" title="C++ Reference" />
 13<link rel="start" href="../index.html" />
 14<link rel="contents" href="http://www.cppreference.com/wiki/escape_sequences?do=index" title="Sitemap" />
 15<link rel="alternate" type="application/rss+xml" title="Recent Changes" href="http://www.cppreference.com/wiki/feed.php" />
 16<link rel="alternate" type="application/rss+xml" title="Current Namespace" href="http://www.cppreference.com/wiki/feed.php?mode=list&amp;ns=" />
 17<link rel="alternate" type="text/html" title="Plain HTML" href="http://www.cppreference.com/wiki/_export/xhtml/escape_sequences" />
 18<link rel="alternate" type="text/plain" title="Wiki Markup" href="http://www.cppreference.com/wiki/_export/raw/escape_sequences" />
 19<link rel="canonical" href="escape_sequences" />
 20<link rel="stylesheet" media="screen" type="text/css" href="lib/exe/css.php@t=custom1&amp;tseed=1289693594" />
 21<link rel="stylesheet" media="all" type="text/css" href="lib/exe/css.php@s=all&amp;t=custom1&amp;tseed=1289693594" />
 22<link rel="stylesheet" media="print" type="text/css" href="lib/exe/css.php@s=print&amp;t=custom1&amp;tseed=1289693594" />
 23<script type="text/javascript" ><!--//--><![CDATA[//><!--
 24var NS='';var JSINFO = {"id":"escape_sequences","namespace":""};
 25//--><!]]></script>
 26<script type="text/javascript" charset="utf-8" src="lib/exe/js.php@tseed=1289693594" ></script>
 27</head>
 28<body>
 29<div class="dokuwiki export">
 30
 31<h2 class="sectionedit1"><a name="constant_escape_sequences" id="constant_escape_sequences">Constant Escape Sequences</a></h2>
 32<div class="level2">
 33
 34<p>
 35
 36The following escape sequences can be used to define certain special characters
 37within strings:
 38
 39</p>
 40<div class="table sectionedit2"><table class="inline">
 41	<tr class="row0">
 42		<th class="col0 centeralign">  Escape Sequence  </th><th class="col1 centeralign">  Description  </th>
 43	</tr>
 44	<tr class="row1">
 45		<td class="col0">\&#039;</td><td class="col1">Single quote</td>
 46	</tr>
 47	<tr class="row2">
 48		<td class="col0">\”</td><td class="col1">Double quote</td>
 49	</tr>
 50	<tr class="row3">
 51		<td class="col0">\\</td><td class="col1">Backslash</td>
 52	</tr>
 53	<tr class="row4">
 54		<td class="col0">\nnn</td><td class="col1">Octal number (nnn)</td>
 55	</tr>
 56	<tr class="row5">
 57		<td class="col0">\0</td><td class="col1">Null character (really just the octal number zero)</td>
 58	</tr>
 59	<tr class="row6">
 60		<td class="col0">\a</td><td class="col1">Audible bell</td>
 61	</tr>
 62	<tr class="row7">
 63		<td class="col0">\b</td><td class="col1">Backspace</td>
 64	</tr>
 65	<tr class="row8">
 66		<td class="col0">\f</td><td class="col1">Formfeed</td>
 67	</tr>
 68	<tr class="row9">
 69		<td class="col0">\n</td><td class="col1">Newline</td>
 70	</tr>
 71	<tr class="row10">
 72		<td class="col0">\r</td><td class="col1">Carriage return</td>
 73	</tr>
 74	<tr class="row11">
 75		<td class="col0">\t</td><td class="col1">Horizontal tab</td>
 76	</tr>
 77	<tr class="row12">
 78		<td class="col0">\v</td><td class="col1">Vertical tab</td>
 79	</tr>
 80	<tr class="row13">
 81		<td class="col0">\xnn</td><td class="col1">Hexadecimal number (nn)</td>
 82	</tr>
 83</table></div>
 84<!-- EDIT2 TABLE [135-455] -->
 85<p>
 86
 87An example of this is contained in the following code (which assumes that the
 88newline character generates complete newlines, i.e. on Unix systems):
 89</p>
 90<pre class="cpp code cpp">    <span class="kw3">printf</span><span class="br0">&#40;</span> <span class="st0">&quot;This<span class="es1">\n</span>is<span class="es1">\n</span>a<span class="es1">\n</span>test<span class="es1">\n</span><span class="es1">\n</span>She said, <span class="es1">\&quot;</span>How are you?<span class="es1">\&quot;</span><span class="es1">\n</span>&quot;</span> <span class="br0">&#41;</span><span class="sy4">;</span></pre>
 91<p>
 92which would display
 93</p>
 94<pre class="code">
 95    This
 96    is
 97    a
 98    test
 99
100    She said, "How are you?"</pre>
101</div>
102</div>
103</body>
104</html>