C++: String Literals

Bjarne-stroustrup
 


Show literal specification of characters and strings. If supported, show how verbatim strings (quotes where escape sequences are quoted literally) and here-strings work. Also, discuss which quotes expand variables.

Quoting is essentially the same in C and C++.

In C++11, it is also possible to use so-called “Raw Strings”:

auto strA = R"(this is
a newline-separated
raw string)";

SOURCE

Content is available under GNU Free Documentation License 1.2.

Subscribe to TFE Times

Enter your email address to become a member of TFE Times today!