Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
//your code here int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); QString qOut = QStringLiteral("输入操作\r\n"); std::cout << qOut.toStdString().c_str(); char input[256]; std::cin >> input; return a.exec(); }
try using std::cout << qPrintable(qOut); or qDebug() << qOut;
std::cout << qPrintable(qOut);
qDebug() << qOut;
@changtj Well, c_str() returns a pointer to a C string which only support ASCII. Try without c_str().
@VRonin said in In my console application, printing chinese characters using std::cout(printf), is messy.:
yes, it is ok. thanks very much!