string-literals.txt 544 B

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