立即学习: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函数的用途:从字符串提取数据到变量