May 2017
Intermediate to advanced
590 pages
17h 18m
English
When string literals are used, escapes are not processed, and the actual content of the string is written between the delimiter (in other words, what you see is what you get). The following example shows what appears as the same raw literal string; however, the second one still contains escaped characters. Since these are not processed in the case of string literals, they will be printed as they are in the output:
auto filename1 {R"(C:\Users\Marius\Documents\)"s}; auto filename2 {R"(C:\\Users\\Marius\\Documents\\)"s}; // prints C:\Users\Marius\Documents\ std::cout << filename1 << std::endl; // prints C:\\Users\\Marius\\Documents\\ std::cout << filename2 << std::endl;
In case the text has to contain the )" sequence, ...
Read now
Unlock full access