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 次
全部评论
相关推荐
09-09 14:20
门头沟学院 Java 点赞 评论 收藏
分享
08-31 01:30
清华大学 Java 点赞 评论 收藏
分享
08-18 22:23
安阳师范学院 Java 大佬们,沟通两千多了呀,在杭州找工作怎么这么南,我就想找个五六千的java开发怎么都是八九千的,只有两个面三四千的java开发实习和五六千的实施,是我简历有问题吗??(都是包装的)我这个学院牛有点死了

点赞 评论 收藏
分享
点赞 评论 收藏
分享