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
...