(1) QString 轉 char*code
char acResult[10240]; //QByteArray baResult = strResult.toLatin1(); QByteArray baResult = strResult.toLocal8Bit(); char *pcResult = baResult.data(); strcpy(acResult, pcResult);
(2) char* 轉QStringit
char acName[] = "huang"; QString strName = QString(QLatin1String(acName)); QString strName = QString::fromUtf8(acName);