How to declare UTF-32 string in C++

1 Answer

0 votes
#include <iostream>     
 
int main () {
    std::u32string str = U"UTF-32 string";

    for (const auto& ch: str)
        std::cout << static_cast<char>(ch);
}
   
   
   
/*
run:
   
UTF-32 string
   
*/

 



answered Nov 27, 2022 by avibootz

Related questions

1 answer 93 views
93 views asked Nov 26, 2022 by avibootz
2 answers 119 views
119 views asked Nov 26, 2022 by avibootz
1 answer 175 views
2 answers 97 views
...