Just a simple question...
I´m trying to do a quite simple thing,read a file which as values displayed like this:
1 2 3
3 4 5
5 6 6
...
and then i´m doing this:
Code:
while(fscanf(fp,"%d %d %d",&noi,&nof,&peso)!=EOF)
{
capacidade[noi][nof] = peso;
}
But the problem is that it keeps reading the same line over and over...I tried a file like this:
John 12
Mary 15
...
and then
Code:
while(fscanf(fp,"%s %d",Name,&age)!=EOF)
printf("%s %d", Name,age);
and its working...Can someone explain to me the difference?