networking · beginner · ~15 min
Tokenise an IPv6 address by ':'.
Implement int count_groups(const char *addr) returning the number of ':'-separated groups in an IPv6 address written in full form (no '::' compression). That is colons + 1.
int count_groups(const char *addr) {
/* TODO */
return 0;
}
Solve this exercise in the browser editor — compile and run against the test harness, no setup required.