Using namespace std::string_literals // enables s-suffix for std::string literalsĪuto m0 = 'abcd' // int, value 0圆1626364Īuto s1 = u8"hello" // const char* before C++20, encoded as UTF-8,Īuto s3 = u"hello" // const char16_t*, encoded as UTF-16Īuto s4 = U"hello" // const char32_t*, encoded as UTF-32 You can also create std::string literals without having to perform extra construction or conversion steps. A raw string literal enables you to avoid using escape characters, and can be used to express all types of string literals. Universal character names and escape characters allow you to express any string using only the basic source character set. In your source code, you express the content of your character and string literals using a character set. C++ supports various string and character types, and provides ways to express literal values of each of these types.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |