Practice · 1 of 3
Count Lines
CHALLENGE
Difficulty: beginner+25 XP
Implement int count_lines(const char *path) opening path for reading and returning the number of lines (a line ends at '\n'; a trailing final line without '\n' still counts; missing file returns -1).
Press Submit to check your solution.
Back to lesson: Practice: File Workbench