Hi all...
How can I get the numer of lines in a file ?
A solution is:
char string[20
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 ?
PS:
while (fscanf(f, "%*s")>0) counter++; doesn't work
PPS: I'm Using Borland C++ Builder
Thx in advance