Here's my code.
#include<stdio.h>
void main(){
FILE *fp;
int a,b;
fp=fopen("hello.txt","r");
while(!feof(fp)){
fscanf(fp,"%d %d",&a,&b);
printf("%d %d\n",a,b);
}
}
My hello.txt is
1 2
3 4
My Output is
1 2
3 4
4 4
Why is my last line being printed twice. Has not fp reached EOF?
Also,the tag in stackoverflow says Usually, when it is used, the code using it is wrong.
What does it mean?
Thanks.