123456789101112131415161718192021222324252627282930 |
- <span class="hljs-comment">// Unicode literals</span>
- <span class="hljs-keyword">auto</span> str = <span class="hljs-string">"Hello regular string"</span>;
- <span class="hljs-keyword">auto</span> utf8 = <span class="hljs-string">u8"Hello utf-8 string"</span>;
- <span class="hljs-keyword">auto</span> utf16 = <span class="hljs-string">u"Hello utf-16 string"</span>;
- <span class="hljs-keyword">auto</span> utf32 = <span class="hljs-string">U"Hello utf-32 string"</span>;
- <span class="hljs-comment">// Wide-character strings</span>
- <span class="hljs-keyword">auto</span> wide_char = <span class="hljs-string">L"Hello wchar_t string"</span>;
- <span class="hljs-comment">// Raw string literals (multiline)</span>
- <span class="hljs-keyword">auto</span> char_multi = <span class="hljs-string">R"(Hello
- normal
- muliline
- string.)"</span>;
- <span class="hljs-keyword">auto</span> utf8_multi = <span class="hljs-string">u8R"(Hello
- utf-8
- muliline
- string)"</span>;
- <span class="hljs-keyword">auto</span> utf16_multi = <span class="hljs-string">uR"(Hello
- utf-16
- muliline
- string)"</span>;
- <span class="hljs-keyword">auto</span> utf32_multi = <span class="hljs-string">UR"(Hello
- utf-32
- muliline
- string)"</span>;
- <span class="hljs-comment">// Meta strings</span>
- <span class="hljs-meta">#<span class="hljs-meta-keyword">include</span> <span class="hljs-meta-string"><stdio></span></span>
- <span class="hljs-meta">#<span class="hljs-meta-keyword">include</span> <span class="hljs-meta-string">"lib.h"</span></span>
|