cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
Impossible to have escape sequence in ra
Impossible to have escape sequence in raw string literal?
Jul 20, 2020 at 11:54pm UTC
highwayman
(578)
I was wondering if the is a way to have an escape sequence in a string literal like \0xa or something of that sort....
R
"(
\0
heonddwnd)"
Jul 21, 2020 at 12:37am UTC
Ganado
(6777)
Wouldn't that defeat the purpose of it being a raw string?
https://imgs.xkcd.com/comics/backslashes.png
Jul 21, 2020 at 1:10am UTC
mbozzi
(3899)
Nope. You could say
"\0" R"eos(heonddwnd)eos"
Relying on the fact that adjacent string literals are concatenated after preprocessing and before compilation.
Jul 21, 2020 at 2:46am UTC
highwayman
(578)
@Ganado yes, yes it would. XD idk, just curious.
@mbozzi hm. I thought that only happens in macros. huh.
thanks yall!
Topic archived. No new replies allowed.