原始字面量就是不进行转义的完整字符串。
原始字符串字面量的定义为:R “xxx(raw string)xxx”
原始字符串必须用括号()括起来,括号的前后可以加其他字符串,所加的字符串会被忽略,并且加的字符串必须在括号两边同时出现。
int main()
{
string str=R"xxx(c\n\n)xxx";
cout << str << endl;
system("pause");
return 0;
}
去掉R 后
int main()
{
string str="xxx(c\n\n)xxx";
cout << str << endl;
system("pause");
return 0;
}