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 次
全部评论
相关推荐
点赞 评论 收藏
分享
10-30 18:20
第一拖拉机制造厂拖拉机学院 C++
牛客41406533...:回答他在课上学,一辈子待在学校的老教授用三十年前的祖传PPT一字一句的讲解,使用谭浩强红皮书作为教材在devc++里面敲出a+++++a的瞬间爆出114514个编译错误来学 点赞 评论 收藏
分享
查看22道真题和解析 点赞 评论 收藏
分享
