当前位置:嗨网首页>书籍在线阅读

13-C++11字符串初始化

  
选择背景色: 黄橙 洋红 淡粉 水蓝 草绿 白色 选择字体: 宋体 黑体 微软雅黑 楷体 选择字体大小: 恢复默认

4.3.1 C++11字符串初始化

正如您预期的,C++11也允许将列表初始化用于C-风格字符串和string对象:

char first_date[] = {"Le Chapon Dodu"};
char second_date[] {"The Elegant Plate"};
string third_date = {"The Bread Bowl"};
string fourth_date {"Hank's Fine Eats"};