How to use quotation marks in QStrings?
-
Hi,
I was wondering:
When I use something like this, how do I have it get quotation marks in the output?qDebug() << "I want this to display in quotation marks:\n";Like, this doesn't work:
qDebug() << ""I want this to display in quotation marks:\n"";Thanks in advance!
-
Hi,
I was wondering:
When I use something like this, how do I have it get quotation marks in the output?qDebug() << "I want this to display in quotation marks:\n";Like, this doesn't work:
qDebug() << ""I want this to display in quotation marks:\n"";Thanks in advance!
-
"is a special character inside a string, so, like with\nyou need to escape it with\:qDebug() << "\"I want this to display in quotation marks:\n\"";or with C++11 you can use it unescaped enclosed in
R"(and)"qDebug() << R"("I want this to display in quotation marks: ")";