Home c++ wcout does not output Cyrillic characters

wcout does not output Cyrillic characters [duplicate]

Author

Date

Category

To display Cyrillic characters Unicode , I used the type wchar_t and the WCout method, but they are not outlined in simple. What needs to be done for their conclusion in the console?


Answer 1, Authority 100%

For example:

# include & lt; locale & gt;
INT MAIN ()
{
  wcout.imbue (Locale ("rus_rus.866"));
  wcin.imbue (Locale ("rus_rus.866"));
  Wstring Name;
  WCOUT & LT; & lt; L "Enter your name:" & lt; & lt; Endl;
  WCIN & GT; & GT; Name;
  WCOUT & LT; & LT; L "Hi" & lt; & lt; Name & lt; & lt; L "!" & lt; & lt; Endl;
  Return 0;
}

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions