码迷,mamicode.com
首页 > 编程语言 > 详细

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

时间:2017-11-05 15:05:35      阅读:207      评论:0      收藏:0      [点我收藏+]

标签:world   标识   warning   ios   tor   ring   warnings   oid   secure   

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 原生字符串字面值

标签:world   标识   warning   ios   tor   ring   warnings   oid   secure   

原文地址:http://www.cnblogs.com/lsgxeva/p/7787376.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!