file-handling · beginner · ~15 min
Streaming character classification without I/O.
Implement size_t buffer_line_count(const char *buf) that counts newline characters in buf. Useful when you've already read a file into memory.
#include <stddef.h>
size_t buffer_line_count(const char *buf) { /* TODO */ return 0; }
Solve this exercise in the browser editor — compile and run against the test harness, no setup required.