Programming Tips - QT: String to char *

Date: 2020jul25 Language: C/C++ Framework: QT Q. QT: String to char * A. Here are two ways:
QString s("hello"); printf("s=%s\n", s.toUtf8().data()); printf("s=%s\n", s.toStdString().c_str());