cybersecurity · beginner · ~15 min · safe pentest lab

Count scanned hosts

Count elements in XML output.

Challenge

Implement int count_hosts(const char *xml) returning the number of <host opening tags.

Starter code

#include <string.h>

int count_hosts(const char *xml) {
    /* TODO */
    return 0;
}

Solve this exercise in the browser editor — compile and run against the test harness, no setup required.