【发布时间】:2013-06-25 01:51:42
【问题描述】:
假设我有一个文件要读取:
//it may contain more than 2 lines
12 6
abadafwg
假设现在我已经像这样阅读了第一行:
char input[999];
while(!feof(fpin))
{
fscanf(fpin, " %[^\n]", input);
//do something here with these numbers
//should do something here to read 2nd line
}
这是我的问题,我如何读取该文件的第二行? 请帮忙QAQ
【问题讨论】:
-
'fscanf(fpin, " %[^\n]", input)' 相同但有空格
-
@PHIfound 这是一个字符串
-
你试过运行这个吗?