【发布时间】:2013-02-12 00:45:56
【问题描述】:
我有以下输入:
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
}
但是代码的执行给了我:illegal instruction
你会如何阅读这样一个逗号分隔的文件?
【问题讨论】: