- 链接地址:https://blog.csdn.net/renyongjian1994/article/details/106023699
- 链接标题:C语言字符串不定长参数处理_c sscanf 不定长输入-CSDN博客
- 所属网站:blog.csdn.net
- 被收藏次数:4543
文章浏览阅读1.1k次。有时候需要写一个不定长参数的传入,怎么办?比如:写一个显示函数 show(char *str);用于在某些特殊屏幕显示。但是这个str 是一个固定的参数,所以要先做 sprintf(str,format,…);然后才能传给它。这样比较麻烦,直接写成 show(char *str,int len,char *format,…);输入不定长参数,更加方便。代码如下:#include <stdlib.h>#include <stdio.h>#include <sys/_c sscanf 不定长输入
版权声明:本文发布于特牛网址导航 内容均来源于互联网 如有侵权联系删除