下面的代码编译不能通过,但是该怎么用 QChar 类型来保存这些汉字?
#include <QtCore>
int main(int argc, char *argv[])
{
QCoreApplication app(argc, argv);
QChar PY_mb_shi[] = {"是十石时士识事食示式使始室势实视试史适施市驶"};
QChar *ptr = PY_mb_shi;
while(ptr)
qDebug() << ptr++;
return app.exec();
}
编译提示错误为:main.cpp:6: error: conversion from `const char[45]' to `QChar' is ambiguous
代码是用写字板写的,这与源程序的编码有关吗?