title: Why might a string literal not be a string?
body: <p>I'm struggling with this part in the C standard about string literals, especially the second part of it:</p>
  
  <blockquote>
    <p>"<em>In translation phase 7, a byte or code of value zero is appended to each multibyte character sequence that results from a string literal or literals. 80)</em>"</p>
    
    <hr>
    
    <p>"<em>80)  A string literal might not be a string (see 7.1.1), because a null character can be embedded in it by a <code>\0</code> escape sequence.</em>"</p>
    
    <p>Source: ISO/IEC 9899:2018 (C18), §6.4.5/6, Page 51</p>
  </blockquote>
  
  <p>I don't understand the explanation - "<em>because a null character can be embedded in it by a <code>\0</code> escape sequence.</em>". </p>
  
  <hr>
  
  <p>To look at the referenced section §7.1.1., regarding the definition of a "string", it is stated:</p>
  
  <blockquote>
    <p>"<em>A string is a contiguous sequence of characters terminated by and including the first null character.</em>"</p>
    
    <p>Source: ISO/IEC 9899:2018 (C18), §7.1.1/1, Page 132</p>
  </blockquote>
  
  <p>I've thought about that the focus maybe lays on the "<em>can</em>", in a way that a string literal does not have to include/embed the null character, while a string is needed to. </p>
  
  <p>But then again I´m asking myself: How is one able to use a string literal as string if it has not a string-terminating null character in it, to determine the end of the string (required for string-operating functions)?</p>
  
  <p>I´m totally drawing blanks at the moment.</p>
  
  <hr>
  
  <p><em>Note</em>: I´m aware of that a string literal is stored in read-only memory and can´t be modified and a string is a generic term for a sequence of characters terminated by NUL, which can or can not be mutable.</p>
  
  <p>Thus, my question is not: "<em>What is the difference between a string and a string literal?</em>"</p>
  
  <p>My Question is: </p>
  
  <ul>
  <li>Why/How can a string-literal not be a string?</li>
  </ul>
  
  <p>and, according to my concerns, so far:</p>
  
  <ul>
  <li>Is it true, that a string literal can have the NUL byte omitted? </li>
  </ul>
  
  <hr>
  
  <p>I wanted to ask this question myself but short before posting it, I got the clue. My confusion was made because of the little misplaced wording inside of the quote. </p>
  
  <p>But I decided to not delete the question´s draft as it could be useful for future readers and provide a Q&amp;A instead.</p>
  
  <p>Feel free to comment and hint.</p>
  
  <hr>
  
  <p>Related stuff:</p>
  
  <ul>
  <li><p><a href="https://stackoverflow.com/questions/1704407/what-is-the-difference-between-char-s-and-char-s">What is the difference between char s[] and char *s?</a></p></li>
  <li><p><a href="https://stackoverflow.com/questions/2245664/what-is-the-type-of-string-literals-in-c-and-c">What is the type of string literals in C and C++?</a></p></li>
  <li><p><a href="https://stackoverflow.com/questions/4493139/are-string-literals-const">Are string literals const?</a></p></li>
  <li><p><a href="https://stackoverflow.com/questions/9970295/life-time-of-a-string-literal-in-c/9970305#9970305">&quot;Life-time&quot; of a string literal in C</a></p></li>
  </ul>