Call a Quote as String

Feb 6, 2021 at 12:31pm
Hello!

I would like to call a quote symbol as a string, nevertheless looks like the code is wrong for the compiler. Could someone show me my mistake? Below follow my code:

 
 std::string double_quote= " " "; 
Last edited on Feb 6, 2021 at 12:33pm
Feb 6, 2021 at 12:34pm
Hello DanielDeChamps,

A single double quote needs to be escaped to be considered a single quote.

Try this std::string double_quote= " \" ";.

Andy
Feb 6, 2021 at 12:47pm
oooh yes! Therefore It is similar to \n to jump lines. Thank you so much.
Last edited on Feb 6, 2021 at 12:47pm
Feb 6, 2021 at 2:18pm
Hello DanielDeChamps,

You are welcome.

I did find this that should help https://stackoverflow.com/questions/10220401/rules-for-c-string-literals-escape-character

Andy
Feb 6, 2021 at 5:37pm
Feb 7, 2021 at 12:02am
I am reading all, thank you so much Handy Andy and Seeplus.
Last edited on Feb 7, 2021 at 12:03am
Topic archived. No new replies allowed.