R string c++ code example
Example 1: raw string in c++
#include <iostream>
int main() {
const char* example2 = "Line1\n"
"Line2\n"
"Line3\n"
"Line4\n"
;
std::cout << example2 << std::endl;
std::cout << "===================================" << std::endl;
const char* example = R"(Line1
Line2
Line3
Line4
)";
std::cout << example << std::endl;
std::cin.get();
}
Example 2: c++ raw string
std::string sRaw = R"(aaa\ttt %)";
std::string sNonRaw = "aaa\ttt %";
std::cout << sRaw << "\n";
std::cout << sNonRaw << "\n";