当前位置:网站首页>C语言 | 获取字符串里逗号间隔的内容
C语言 | 获取字符串里逗号间隔的内容
2022-07-31 05:11:00 【Benni-King】
#include <stdio.h>
int main()
{
int i=0;
char** paraList = calloc(30, sizeof(char));
char str[] = "abc , I am good , you good too";
char delims[] = ",";
char *result = NULL;
result = strtok(str, delims);
while (result != NULL) {
printf("result is \"%s\"\t", result);
while (*result == ' '|| *result == '\t') result++;
printf("result is \"%s\"\n", result);
paraList[i] = result;
i++;
result = strtok(NULL, delims);
}
}
边栏推荐
猜你喜欢

leetcode-每日一题1252. 奇数值单元格的数目(模拟优化)

gin框架学习-Casbin进阶之策略管理API使用方法

Kubernetes certificate validity period modification

代码块、Package,Import,封装(第六天)

最新MySql安装教学,非常详细

元宇宙的前景及四大赛道

Linux修改MySQL数据库密码

If the account number or password is entered incorrectly for many times, the account will be banned.
![[Cloud native] Ribbon is no longer used at the bottom layer of OpenFeign starting from the 2020.0.X version](/img/7e/1d27e3f1856ab8c6cbfc5221c717bb.png)
[Cloud native] Ribbon is no longer used at the bottom layer of OpenFeign starting from the 2020.0.X version

12 【网页布局总结 元素的显示与隐藏】
随机推荐
【数据库学习】Redis 解析器&&单线程&&模型
11 【组件通信】
Linux中mysql密码修改方法(亲测可用)
利用phpstudy搭建DVWA
uni-app进阶之内嵌应用【day14】
vulhub靶场学习日记hackme1
Oracle数据库中的“limit”查询
12 【nextTick 过渡与动画】
变量的解构赋值
[JVM Loading]---Class Loading Mechanism
[Ubuntu20.04 installs MySQL and MySQL-workbench visualization tool]
“档次法”——用于物品体积分布不均匀的01背包问题的求解方法
"limit" query in Oracle database
【windows】--- SQL Server 2008 超详细安装教程
Yuan prospect and four track of the universe
Volatility取证工具使用日记
什么是EVM兼容链?
元宇宙的前景及四大赛道
GUCCI、LV等奢侈品巨头如何布局元宇宙的,其他品牌应该跟上吗?
npm WARN config global `--global`, `--local` are deprecated. Use `--location解决方案