This would be the part where I do the readings
do {
res=0;
res += fscanf(in , "%50s",recs[n].city);
res += fscanf(in , "%d.%d.%d ", &recs[n].d.d , &recs[n].d.m , &recs[n].d.y);
res += fscanf(in , "%f", &recs[n].t );
recs = realloc(recs, (n+2)*68);
if(!recs){
printf("Error for second recs");
return 0;
}
n++;
}while(res == 5);
My input file :
Germany 8.01.2020 54.24
Romania 1.2.2019 34.55
Banat 5.1.1999 41.66
Region 4.5.2023 51.71
Idk 12.11.1967 91.981
My output :
Germany 8 1 2020 54.240002
Romania 1 2 2019 34.549999
Banat 5 1 1999 41.660000
Region 4 5 2023 51.709999
Idk 12 11 1967 91.981003
So basically my question is why does fscanf reads 51.709999 instead of 51.71 for example.