I am trying to make some code that was handed to me more user friendly. I want to find a function that will scan the input file for the number of lines. Currently the first line of the input file contains the file length in lines. The rest of the code uses that number to iterate
Code:
int inum_rows;
fpin0 = fopen("table_eng_la1.dat","r");
fscanf(fpin0,"%d",&inum_rows);
for(i = 0; i < inum_rows; i++)
{
fscanf(fpin0,"%lf %lf %lf %lf",&table_eng0[i], &table_eng1[i],
&table_eng2[i], &table_eng3[i]);
}
fclose(fpin0);
for(i = 0; i < inum_rows; i++)
/*Do Something */
Please make your recommendations simple....... I am not a programmer......... Thanx!!!!!!!!!