char* str_p = myQString.toAscii().constData();
qDebug("%s", str_p );
char* str_p = myQString.toAscii().constData();
qDebug("%s", str_p );
To copy to clipboard, switch view to plain text mode
when I try to compile your code, I get:
C:/dev/testproj/mainwindow.cpp:11: error: invalid conversion from `const char*' to `char*'
instead, do the following:
const char* str_p = myQString.toAscii().constData();
qDebug("%s", str_p );
const char* str_p = myQString.toAscii().constData();
qDebug("%s", str_p );
To copy to clipboard, switch view to plain text mode
This gives me the correct string.
Bookmarks