Practice ยท 1 of 3
Count Lines
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).
Difficulty: beginner
Press Submit to check your solution.
Back to lesson: Practice: File Workbench