当前位置:网站首页>[C language] add separator to string
[C language] add separator to string
2022-06-25 07:11:00 【ChenXiaoMing start】
Action()
{
char str[]="12345";
char result_str[1024];
add_break(str,",",result_str);
lr_error_message("%s\n",result_str);
return 0;
}
void add_break(char * str,char * str_break,char result_str[1024]){
int i = 0;
int str_len=strlen(str);
memset(result_str,0,sizeof(result_str));
sprintf(result_str,"%c",str[0]);
for (i=1;i<str_len;i++) {
sprintf(result_str,"%s%s%c",result_str,str_break,str[i]);
}
}
边栏推荐
- Blue Bridge Cup SCM module code (matrix key) (code + comments)
- mysql 表查询json数据
- keil debug查看变量提示not in scope
- 1W字|40 图|硬核 ES 实战
- The upper and lower lines of the shell are merged into one line
- Kubernetes cluster dashboard & kuboard installation demo
- 1W words | 40 pictures | hard core es actual combat
- Fastadmin cascade clear data
- [ACNOI2022]王校长的构造
- Efficient exploration | an application practice of ES geographical location query
猜你喜欢

Finally, when you open source the applet ~

Navicat防止新建查询误删
![Analysis on the output, market scale and development status of China's children's furniture industry in 2020 and the competition pattern of children's furniture enterprises [figure]](/img/3a/e7a7ed1390664a6660112713266bdc.jpg)
Analysis on the output, market scale and development status of China's children's furniture industry in 2020 and the competition pattern of children's furniture enterprises [figure]

Want to self-study SCM, do you have any books and boards worth recommending?

1W字|40 图|硬核 ES 实战

【一起上水硕系列】Day 4

The significance and proof of weak large number theorem

Flask 的入门级使用

Event registration Apache pulsar x kubesphere online meetup hot registration

Design of PWM breathing lamp based on FPGA
随机推荐
Want to self-study SCM, do you have any books and boards worth recommending?
Ctfhub web information disclosure directory traversal
Event registration Apache pulsar x kubesphere online meetup hot registration
燕京啤酒何以至此?
Analysis on the scale of China's smart airport industry in 2020: there is still a large space for competition in the market [figure]
Are these old system codes written by pigs?
Derivation of sin (a-b) =sina*cosb-sinb*cosa
shell 上下两行合并成一行
[Shangshui Shuo series] day 4
【一起上水硕系列】Day 5
Solar orbiter captured the full picture of the largest prominence eruption in history
TorchServe避坑指南
Atomic alpha development board -- SD card and EMMC burning tool
Cloning and importing DOM nodes
聚类和分类的最基本区别。
Unity获取资源路径
Navicat防止新建查询误删
[2022 dark horse programmer] SQL optimization
What is the real future of hardware engineers?
单片机IO详解(上拉 下拉 准双向 输入 输出 推挽 开漏)