PageRenderTime 47ms CodeModel.GetById 20ms RepoModel.GetById 0ms 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[//><!--
  24. var 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. <h2 class="sectionedit1"><a name="constant_escape_sequences" id="constant_escape_sequences">Constant Escape Sequences</a></h2>
  31. <div class="level2">
  32. <p>
  33. The following escape sequences can be used to define certain special characters
  34. within strings:
  35. </p>
  36. <div class="table sectionedit2"><table class="inline">
  37. <tr class="row0">
  38. <th class="col0 centeralign"> Escape Sequence </th><th class="col1 centeralign"> Description </th>
  39. </tr>
  40. <tr class="row1">
  41. <td class="col0">\&#039;</td><td class="col1">Single quote</td>
  42. </tr>
  43. <tr class="row2">
  44. <td class="col0">\”</td><td class="col1">Double quote</td>
  45. </tr>
  46. <tr class="row3">
  47. <td class="col0">\\</td><td class="col1">Backslash</td>
  48. </tr>
  49. <tr class="row4">
  50. <td class="col0">\nnn</td><td class="col1">Octal number (nnn)</td>
  51. </tr>
  52. <tr class="row5">
  53. <td class="col0">\0</td><td class="col1">Null character (really just the octal number zero)</td>
  54. </tr>
  55. <tr class="row6">
  56. <td class="col0">\a</td><td class="col1">Audible bell</td>
  57. </tr>
  58. <tr class="row7">
  59. <td class="col0">\b</td><td class="col1">Backspace</td>
  60. </tr>
  61. <tr class="row8">
  62. <td class="col0">\f</td><td class="col1">Formfeed</td>
  63. </tr>
  64. <tr class="row9">
  65. <td class="col0">\n</td><td class="col1">Newline</td>
  66. </tr>
  67. <tr class="row10">
  68. <td class="col0">\r</td><td class="col1">Carriage return</td>
  69. </tr>
  70. <tr class="row11">
  71. <td class="col0">\t</td><td class="col1">Horizontal tab</td>
  72. </tr>
  73. <tr class="row12">
  74. <td class="col0">\v</td><td class="col1">Vertical tab</td>
  75. </tr>
  76. <tr class="row13">
  77. <td class="col0">\xnn</td><td class="col1">Hexadecimal number (nn)</td>
  78. </tr>
  79. </table></div>
  80. <!-- EDIT2 TABLE [135-455] -->
  81. <p>
  82. An example of this is contained in the following code (which assumes that the
  83. newline character generates complete newlines, i.e. on Unix systems):
  84. </p>
  85. <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>
  86. <p>
  87. which would display
  88. </p>
  89. <pre class="code">
  90. This
  91. is
  92. a
  93. test
  94. She said, "How are you?"</pre>
  95. </div>
  96. </div>
  97. </body>
  98. </html>