#include <iostream>
using namespace std;
int main(){
//“\”表示转义字符,会解析h和w,使用原始字面量的方法就不会出现这种情况、
//两边的hello相对于是注释,但是必须相同,否则报错
string str1=R"hello(D:\hello\world.text)hello";
//string str1="D:\\hello\\world.text";//不使用原始字面量就应该写成这样
cout<<str1<<endl;
system("read");
return 0;
}
C++11新特性:原始字面量
最新推荐文章于 2024-08-03 18:36:56 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)