我有以下输入:
AG23,VU,Blablublablu,8
IE22,VU,FooBlaFooBlaFoo,3
and so on...
Run Code Online (Sandbox Code Playgroud)
我希望它使用像这样的代码"解析"scanf:
char sem[5];
char type[5];
char title[80];
int value;
while(scanf("%s,%s,%s,%d", sem, type, title, &value) == 4) {
//do something with the read line values
}
Run Code Online (Sandbox Code Playgroud)
但代码的执行给了我:illegale instruction
你会如何读取这样的逗号分隔文件?