QString to Char* 转换

QString str1 = "Test";
QByteArray ba = str1.toLocal8Bit();
const char * c_str2 = ba.data();

 

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.