networking · beginner · ~15 min
Recognise the loopback range.
Implement int is_loopback(int a, int b, int c, int d) returning 1 if the dotted-quad address is in 127.0.0.0/8 (first octet 127), else 0.
int is_loopback(int a, int b, int c, int d) {
/* TODO */
return 0;
}
Solve this exercise in the browser editor — compile and run against the test harness, no setup required.