http://www.cplusplus.com/reference/cstdio/sscanf/?kw=sscanf
/* sscanf example */
#include <stdio.h>
int main ()
{
char sentence []="Rudolph is 12 years old";
char str [20];
int i;
sscanf (sentence,"%s %*s %d",str,&i);
這裡表示 Rudolph is 12 = %s %*s %d
%*s 代表忽略,如果是 %*d 代表忽略的為數字
printf ("%s -> %d\n",str,i);
return 0;
}
輸出 Rudolph -> 12