学习笔记(03):《ACM竞赛-C/C++入门》 C语言-4-sscanf实战数据挖取

立即学习:https://edu.csdn.net/course/play/21076/260777?utm_source=blogtoedu

sscanf数据挖掘例子:

char str[100]="李生  男  21  大学“;

int age;

sscanf(str,” %*s,%*s  ,%d,   %*s ", &age);

上面代码的作用是将str字符串里的21提取到age变量中。(注意sscanf函数内,双引号之间,%*s中,*表示跳过此项)

sscanf函数的用途:从字符串提取数据到变量

发布了3 篇原创文章 · 获赞 0 · 访问量 1

猜你喜欢

转载自blog.csdn.net/weixin_43345275/article/details/104981510