How to convert QString to C String (char *)

Posted on Posted in Qt Tutorials, Tutorials

The best solution for this would be to go through standard C++ and it means this:

Let’s say you have a QString, like this:

QString s = “”;


First convert it to std::string and then use its c_str method, like this:


Leave a Reply

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