c++windowsqtqt4lpcstr

How to convert QString to LPCSTR (Unicode)


how can I convert QString to LPCSTR ?

How do I do it when #ifdef UNICODE is defined and when it isn't ?

Thanks very much :)


Solution

  • I guess:

    QString str("ddddd");
    LPCSTR lstr = str.toStdString().c_str();