title: Rules for C++ string literals escape character
body: <p>What are the rules for the escape character <code>\</code> in string literals? Is there a list of all the characters that are escaped?</p>
  
  <p>In particular, when I use <code>\</code> in a string literal in gedit, and follow it by any three numbers, it colors them differently.</p>
  
  <p>I was trying to create a <code>std::string</code> constructed from a literal with the character <code>0</code> followed by the null character (<code>\0</code>), followed by the character <code>0</code>. However, the syntax highlighting alerted me that maybe this would create something like the character <code>0</code> followed by the null character (<code>\00</code>, aka <code>\0</code>), which is to say, only two characters.</p>
  
  <p>For the solution to just this one problem, is this the best way to do it:</p>
  
  <pre><code>std::string ("0\0" "0", 3)  // String concatenation 
  </code></pre>
  
  <p>And is there some reference for what the escape character does in string literals in general? What is '\a', for instance?</p>