How can I get the numer of lines in a file ?
A solution is:
int counter = 0;
f = fopen ("blabla.txt", "r");
while (fscanf(f, "%s", string)>0) counter++;
But.. is there a better solution ? one which doesn't waste memory allocating a variable ?
while (fscanf(f, "%*s")>0) counter++; doesn't work
PPS: I'm Using Borland C++ Builder
Thx in advance