Count The Number Of Lines In A File | C Programming Example

preview_player
Показать описание
Рекомендации по теме
Комментарии
Автор

thank you! It was really helpful that you broke down each step!

gbs
Автор

thank you so much, clean and clear explanation !

salami
Автор

This is wrong. EOF is not a character, so by casting it to a char in the assignment you are making its value be the same as another ASCII character, thus making the program think the file has ended when in reality it has just encountered a normal character.

pollomagico
Автор

Hello! Why do we initialize the line counter to =1 instead of =0? Thanks for answering.

daniughoc