当前位置:网站首页>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);
}
}
边栏推荐
猜你喜欢

Volatility取证工具使用日记
uni-app进阶之内嵌应用【day14】

DeFi 项目中的治理Token

Linux中mysql密码修改方法(亲测可用)
![[uiautomation] Get WeChat friend list (stored in txt)](/img/26/1f3424c5998c52c6e10ced8529012a.png)
[uiautomation] Get WeChat friend list (stored in txt)

leetcode-每日一题558. 四叉树交集(分治递归)

MySql创建数据表

【C语言3个基本结构详解——顺序、选择、循环】

On the side of Ali, tell me what are the application scenarios of message middleware you know?

【ubuntu20.04安装MySQL以及MySQL-workbench可视化工具】
随机推荐
为什么redis是单线程还那么快?
vulhub靶场学习日记hackme2
【Elastic-Job源码分析】——作业监听器
【windows】--- SQL Server 2008 超详细安装教程
Error: Cannot find module ‘D:\Application\nodejs\node_modules\npm\bin\npm-cli.js‘
10 【高度塌陷与BFC】
(Crypto essential dry goods) Detailed analysis of the current NFT trading markets
vulhub靶场学习日记SickOs1.2
阿里一面,说说你知道消息中间件的应用场景有哪些?
uni-app进阶之模版语法与数据绑定【day7】
2021面经-拥抱变化
uni-app进阶之生命周期【day8】
Flink sink redis writes to Redis
元宇宙的前景及四大赛道
Linux modify MySQL database password
【云原生】开源数据分析 SPL 轻松应对 T+0
gin框架学习-Gin框架和Gorm框架搭建一个简单的API微服务
5 methods of MySQL paging query
正则表达式基础知识
最新MySql安装教学,非常详细