PhotoShaman

Кириллица string c++

Dec 21st, 2016
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.35 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <locale>
  4.  
  5. using namespace std;
  6.  
  7. int main() {
  8.     locale::global(locale(""));
  9.     wcout.imbue(locale(".1251"));
  10.     wcin.imbue(locale(".866"));
  11.  
  12.     wstring name;
  13.     wcout << L"Как тебя зовут? ";
  14.     wcin >> name;
  15.     wcout << L"Добро пожаловать, " << name;
  16.  
  17.     cin.get();
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment