逗号分隔输入我有以下输入:阅读scanf函数
AG23,VU,Blablublablu,8
IE22,VU,FooBlaFooBlaFoo,3
and so on...
我希望它使用像这样的代码“解析”与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
}
不过的执行代码给我:illegale instruction
你会如何阅读这样一个逗号分隔的文件?
你的“最好的选择”的问题是它也不能很好地工作。 – 2018-01-09 21:03:02