所谓原始字符串就是字符表示的就是自己,引号和斜杠均无需\进行转义。C++使用R“(a string)”来标识原始字符串:
cout << R"(I don't have to use '\' to print "\n" in the screen.)" << endl;
上述代码将显示如下内容:
I don't have to use '\' to print "\n" in the screen.
所谓原始字符串就是字符表示的就是自己,引号和斜杠均无需\进行转义。C++使用R“(a string)”来标识原始字符串:
cout << R"(I don't have to use '\' to print "\n" in the screen.)" << endl;
上述代码将显示如下内容:
I don't have to use '\' to print "\n" in the screen.