c++11 原生字符串字面值

时间:2023-03-08 21:53:13

c++11 原生字符串字面值

#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <string>
#include <vector>
#include <map> void mytest()
{
/*
原生字符串字面值(raw string literal)使用户书写的字符串“所见即所得”。
C++11中原生字符串的声明相当简单,只需在字符串前加入前缀,即字母R,并在引号中使用括号左右标识,就可以声明该字符串字面量为原生字符串了。
*/
std::cout << R"(hello,\n
world)" << std::endl; return;
} int main()
{
mytest(); system("pause");
return ;
}