c#(或c ++ 11)中是否有类似于c#的@ like?

Gis*_*way 5 c++

在C#中,我们可以用@定义一个复杂的字符串:

string str = @"This is the first line.\r\nThis is still the first line";
Run Code Online (Sandbox Code Playgroud)

在C++中怎么样?如果我们有这样的东西,我们不需要为所有特殊字符使用转换符号'\'.

pol*_*ver 6

在C++ 11(仅)中,您可以使用原始字符串文字:

std::string str = R"(This is the first line.\r\nThis is still the first line)";
Run Code Online (Sandbox Code Playgroud)