1、C++字符串分割:
vector<string> pathToVector(string thePath) //对string路径按进行分割
{
stringstream ss(thePath);
string tmp;
vector<string> result;
while (getline(ss, tmp, ))
result.emplace_back(tmp);
return result;
}
2、C++ 11对的push_back, push_front, insert 增加了新的用法,与之对应的是emplace_back,emplace_front, emplace.
vector<string> pathToVector(string thePath) //对string路径按进行分割
{
stringstream ss(thePath);
string tmp;
vector<string> result;
while (getline(ss, tmp, ))
result.emplace_back(tmp);
return result;
}
2、C++ 11对的push_back, push_front, insert 增加了新的用法,与之对应的是emplace_back,emplace_front, emplace.
2022-07-20
在牛客打卡2天,今天学习:刷题 4 道/代码提交 15 次
全部评论
相关推荐
点赞 评论 收藏
分享
11-25 12:47
湘潭大学 C++ 点赞 评论 收藏
分享
11-05 14:35
重庆邮电大学 前端工程师
牛客35671670...:招个实习生最后还要横向挂人😅,还是日常实习生。这给惯的。实习生最终审核还挂就不要走这么多轮技术面。我爱说实话 点赞 评论 收藏
分享
点赞 评论 收藏
分享