Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

escape sequence? using quotes in Qstring

Tags:

c++

c

escaping

qt

I'm using Qt creator 2.4. I need to use a string say hi"world" in my code. I have tried to use Qstring and std::string and I know / is the escape sequence character but the IDE doesn't understand it as an escape sequence and gives errors when I write:

"hi/"world/""

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

like image 596
user1484717 Avatar asked Jul 05 '12 17:07

user1484717


1 Answers

Use it like this:

QString output = "Hi \"world\"!";
like image 79
Exa Avatar answered Sep 28 '22 02:09

Exa