I have the following code and the compiler doesn't show me any error or warning messages. But although the conditions are fulfilled it doesn't do what I want.
#include <stdio.h>
int main()
{
FILE *f,*g;
f = fopen("MPCORB_Distant.txt","r");
g = fopen("MPCORB_Distant_AvgKBOValues.txt","w");
float Nbr,H,G,Epoch,M,w,W,i,e,n,a,UP,Ref,Obs,Opp,Arc,rms,Pert1,Pert2,
Comp,Type,Name,LastObs;
float Res_a,Res_e,Res_i,Res_W,Res_w;
while(!feof(f))
{
fscanf(f,"%f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f\n",
&Nbr,&H,&G,&Epoch,&M,&w,&W,&i,&e,&n,&a,&UP,&Ref,&Obs,&Opp,&Arc,&rms,&Pert1,
&Pert2,&Comp,&Type,&Name,&LastObs);
if ( a > 60 )
{
fprintf(g,"%f %f %f %f %f\n",a,e,i,W,w);
}
else
{
}
}
fclose(f);
fclose(g);
return 0;
}
When I write a printf("Hello\n");
inside the else condition it doesn't stop writing. It seems not to enter the if-condition at all, despite the condition being fulfilled quite soon in the list of the file that is read.