Is there a way in C++ to quote a string without having to escape with backslashes? For example, I would like a way to store some Latex code in a string, such as \documentclass{article}. I could do
string latex_code = "\\documentclass{article}"
But that gets annoying when you have to escape a lot of things, for example if you have a lot of Latex code. In Perl, I remember that you have some very useful quoting tools. See, for example, the “q” and “qq” sections here:
http://www.perlmonks.org/?node_id=401006
Is there something similar in C++? The only other thing I can think of is to paste the Latex code into an external file and read it in. But that also seems annoying.
C++11 has a way:
http://en.wikipedia.org/wiki/C%2B%2B11
It’s not possible in C++03.