I have been looking and determined that there is no C function that counts the number of lines in a file. I would like to make a function to do this but do not really know how. So far I have thisThis for some reason always seems to return 0 though. Can someone please help with this. Thanks.Code:int linecount (FILE *file){
char ar[1024];
int count=0;
while(feof(file)==0){
fgets(ar,1024,file);
count++;
}
return(count);
}
~Sven