Cyrillic in c ++, how to work with wstring?

  • 0
    How to work with Russian letters in c ++? the output is empty. Is there a way to rewrite a string in L ""?
    #include <iostream>
    #include <string>
    using namespace std;
    
    int main()
    {
        wstring myStr;
        getline(wcin , myStr); 
        wcout << myStr[0] << endl; 
        return 0;
    }
    C++ Anonymous, Mar 2, 2020

  • 2 Answers
  • 0
    setlocale (LC_ALL, “ru”); - insert at the beginning of main.
    Matthew Best

  • 0
    locale :: global (locale (". 866", locale :: all));

    It should work on VS19 + Win10, almost certainly not somewhere else.
    Isabelle Griffith

Your Answer
To place the code, please use CodePen or similar tool. Thanks you!