string-literals.expect.txt 1.5 KB

123456789101112131415161718192021222324252627282930
  1. <span class="hljs-comment">// Unicode literals</span>
  2. <span class="hljs-keyword">auto</span> str = <span class="hljs-string">"Hello regular string"</span>;
  3. <span class="hljs-keyword">auto</span> utf8 = <span class="hljs-string">u8"Hello utf-8 string"</span>;
  4. <span class="hljs-keyword">auto</span> utf16 = <span class="hljs-string">u"Hello utf-16 string"</span>;
  5. <span class="hljs-keyword">auto</span> utf32 = <span class="hljs-string">U"Hello utf-32 string"</span>;
  6. <span class="hljs-comment">// Wide-character strings</span>
  7. <span class="hljs-keyword">auto</span> wide_char = <span class="hljs-string">L"Hello wchar_t string"</span>;
  8. <span class="hljs-comment">// Raw string literals (multiline)</span>
  9. <span class="hljs-keyword">auto</span> char_multi = <span class="hljs-string">R"(Hello
  10. normal
  11. muliline
  12. string.)"</span>;
  13. <span class="hljs-keyword">auto</span> utf8_multi = <span class="hljs-string">u8R"(Hello
  14. utf-8
  15. muliline
  16. string)"</span>;
  17. <span class="hljs-keyword">auto</span> utf16_multi = <span class="hljs-string">uR"(Hello
  18. utf-16
  19. muliline
  20. string)"</span>;
  21. <span class="hljs-keyword">auto</span> utf32_multi = <span class="hljs-string">UR"(Hello
  22. utf-32
  23. muliline
  24. string)"</span>;
  25. <span class="hljs-comment">// Meta strings</span>
  26. <span class="hljs-meta">#<span class="hljs-meta-keyword">include</span> <span class="hljs-meta-string">&lt;stdio&gt;</span></span>
  27. <span class="hljs-meta">#<span class="hljs-meta-keyword">include</span> <span class="hljs-meta-string">"lib.h"</span></span>