Is the开发者_如何学Cre any example Code showing How to accept Arabic Input from user in C++ on a console application, in windows?
I'll try answer the C++ part. You cannot read arabic characters from console with cin
. However in <iostream>
there's a predeclared wcin
object that is of type wistream
- a wide-character input stream. And you should read an input not into string
but into wstring
.
e.g
#include <iostream>
#include <string>
int main()
{
std::wstring s;
std::wcin >> s;
}
This was the C++ part, however the question remains whether or not your OS allows wide characters in the console window. HTH
精彩评论