cybersecurity · intermediate · ~15 min · safe pentest lab
Count lines matching a status token.
Implement int count_404s(const char *log) returning the number of lines that contain " 404 " (the HTTP status surrounded by spaces).
#include <string.h>
int count_404s(const char *log) {
/* TODO */
return 0;
}
Solve this exercise in the browser editor — compile and run against the test harness, no setup required.