当前位置:网站首页>code snippet
code snippet
2022-07-20 16:10:00 【平丘月初】
按格式拆分string
void split(const std::string &s, std::vector<std::string> &sv,
const char *delim = " ") {
sv.clear();
char *buffer = new char[s.size() + 1];
buffer[s.size()] = '\0';
std::copy(s.begin(), s.end(), buffer);
char *p = std::strtok(buffer, delim);
do {
sv.emplace_back(p);
} while ((p = std::strtok(NULL, delim)));
delete[] buffer;
return;
}
边栏推荐
- 半导体新晋独角兽,TCL刚刚投了18亿
- 效率提升98%!高海拔光伏电站运维巡检背后的AI利器
- 李宏毅老师2020年深度学习系列讲座笔记9
- kakfa常用命令
- Some easily confused pointers [summary direction]
- 氢创未来,中国氢能联盟举办2022氢能专精特新创业大赛启动仪式
- Self study notes on Bayesian probability and Bayesian networks and Bayesian causal networks
- VMware低版本启动虚拟机蓝屏解决方案(重启了3天才安装好的经验,装前必看)
- Transmission 下载列表、下载文件 迁移机器指南
- 我想问下ODPS的建表ddl不能直接在mysql里执行,STRING类型不兼容,这个是只能自己调整吗
猜你喜欢
遮天三部曲
堆排序总结
业务出海,灵感乍现前要先「把手弄脏」
[wechat applet] xxxxx is not in the following list of socket legal domain names, please refer to the document
半导体新晋独角兽,TCL刚刚投了18亿
李宏毅老师2020年深度学习系列讲座笔记8
深度学习基础与实践课程笔记0&1
(‘You must install pydot (`pip install pydot`) and install graphviz...)
云开发寝适闹钟微信小程序源码
会员数继续下滑,Netflix能靠广告突围吗?
随机推荐
单元测试,写起来到底有多痛?你会了吗
链表(五)——删除链表的倒数第N个节点
19_内置指令
In July, the "China database industry analysis report" was released! Be prepared for danger in times of safety, safety first
力扣------有多少小于当前数字的数字
%s、%1$s、%d、%1$d占位符
es6新增-iterator遍历器,for..of循环
堆排序复习
李宏毅老师2020年深度学习系列讲座笔记5
Detailed explanation of class, classloder, Dex
21_ life cycle
实体服务是一种反模式
yaml编写规则以及YAML和JSON对比
如何将过长的链接放到excel里面
coding构建镜像,继承自建基础镜像报错 unauthorized: Invalid credential. 请确认输入了正确的用户名和密码。
NVIDIA Inspector 详细使用说明书
SQLite 数据库操作
记一次使用Redisson踩坑问题
看项目代码笔记1
百度网盘 yundetectservice.exe可以禁用关闭吗