const char *s = R"(apple)";
R"()" 是什么语法?
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
using namespace std;
int main()
{
const char* s = R"(apple)";
printf("%s\n", s);
system("pause");
return 0;
}
const char *s = R"(apple)";
R"()" 是什么语法?
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
using namespace std;
int main()
{
const char* s = R"(apple)";
printf("%s\n", s);
system("pause");
return 0;
}
用来避免转义字符
// Raw string literals containing unescaped \ and "
auto R0 = R"("Hello \ world")"; // const char*
auto R1 = u8R"("Hello \ world")"; // const char*, encoded as UTF-8
auto R2 = LR"("Hello \ world")"; // const wchar_t*
auto R3 = uR"("Hello \ world")"; // const char16_t*, encoded as UTF-16
auto R4 = UR"("Hello \ world")"; // const char32_t*, encoded as UTF-32