Reading file using fscanf() in C

后端 未结 4 1828
迷失自我
迷失自我 2020-12-05 11:30

I need to read and print data from a file.
I wrote the program like below,

#include
#include
int main(void)
{
char item[9         


        
4条回答
  •  自闭症患者
    2020-12-05 11:58

    First of all, you're testing fp twice. so printf("Error Reading File\n"); never gets executed.

    Then, the output of fscanf should be equal to 2 since you're reading two values.

提交回复
热议问题