1. 程式人生 > >c++11 原生字符串字面值

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

標識 stream c++ 簡單 cout fine def 字符 pan

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 0; }

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