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

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -