C 知道
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
报告相同问题?
程序员都在用的中文IT技术交流社区
专业的中文 IT 技术社区,与千万技术人共成长
关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!