String类型

  • 遍历String
    string str("string");
    for(auto s: str){
      cout<<c<<endl;
    }
  • 遍历String并改变字符
    string str("string");
    for(auto &s: str){
      c = toupper(c);
    }
    cout<<c<<endl;
  • auto&&decltype
    int i = 42;
    //decltype(i)   int  类型
    //decltype((i)) int& 类型
    //auto j = i int类型
全部评论

相关推荐

自由水:笑死了,敢这么面试不敢让别人说
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务