0

How do you print a symbol used as a function w/o it executing the function? Eg, print quotes (" ") or slashes (\) as text?

Symbol printing C++

14th Jan 2019, 7:27 PM
Adam
4 Réponses
+ 2
Did you copy the whole thing? Only the lines starting with cout are code! Basically, you only have to put a \ in front of a " and you can output it.
14th Jan 2019, 10:48 PM
HonFu
HonFu - avatar
+ 2
By 'escaping' it. " : cout << "\"Howdy\" he said"; \ : cout << "Let's write \\";
14th Jan 2019, 7:37 PM
HonFu
HonFu - avatar
0
What lesson is "escaping" in? I attempted to copy-paste your code in its own file, but it said it wasn't a closed expression or something. I'm just learning this, but find I learn better if I learn what I need to know as I go. I haven't run across it yet.
14th Jan 2019, 10:38 PM
Adam
0
No, I thought the " : was part of it. I will practice escaping to make sure I have it down. Most appreciated. Thank you.
15th Jan 2019, 4:27 AM
Adam