c - How can I quickly determine the amount of rows in a text file? -


I'm new to using C programming, I was wondering what the function call is that the amount is quickly Can be used to determine the rows in a text file.

  integer number (char * fileName) {FILE * f; Four c; Int lines = 0; F = fopen (filename, "r"); If returned (f ==) 0; While ((C = fgetc (f)) = EOF) if (C == '\ n') lines ++; Fclose (f); If (c! = '\ N') lines ++; Return lines; }  

Comments

Popular posts from this blog

objective c - iPhone and it's wireless area -

unix - Listing all shared memory segments used by a process on AIX5.3+ -

tsql - Correct sql/hql query (aggregate in where clause) -