G
G
German2018-12-17 17:46:16
C++ / C#
German, 2018-12-17 17:46:16

wcout input not working and typing wrong characters?

Actually, after the first input, the output of the contents of the variable is inadequate, MessageBox fulfills immediately, skipping the second output, nonsense.
5c17b5da0ee41430697339.png
The project settings are set to Unicode, wchar_t should be suitable, maybe there is a problem with reading?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vasily Melnikov, 2018-12-18
@mrjbom

setlocale(LC_ALL, "Russian.UTF16");
std::wstring ws;
std::getline(wcin, ws);
By the way, it will also work without setlocale

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question