1. 函数定义
int sscanf ( const char * str, const char * format, ...);
有一种用法:
代码中的 %*s 表明忽略一个字符串, 其中*的定义如下
| * | An optional starting asterisk indicates that the data is to be retrieved from the str string but ignored, i.e. it is not stored in the corresponding argument. |
同理也可以将数字忽略
本文介绍如何利用C语言中的sscanf函数来解析字符串,并通过特定格式说明符跳过不需要的数据部分。例如,可以使用%*s来跳过一个字符串,而不会将其存储在变量中。同样适用于跳过数字等其他数据类型。
118

被折叠的 条评论
为什么被折叠?



