Escape sequence? using quotes in Qstring

I am using Qt creator 2.4. I need to use a string in text hi"world"in my code. I tried using Qstringand std::string, and I know what /is the escape character, but the IDE does not understand it as an escape sequence and gives write errors:

"hi/"world/""

I can use any string format that can be converted to Qstring. Any ideas what I'm doing wrong?

+5
source share
1 answer

Use it as follows:

QString output = "Hi \"world\"!";
+9
source

All Articles