networking · beginner · ~15 min
Know which ports require privilege to bind.
Implement int needs_root_to_bind(int port) returning 1 if port is a privileged port (1..1023), else 0.
int needs_root_to_bind(int port) {
/* TODO */
return 0;
}
Solve this exercise in the browser editor — compile and run against the test harness, no setup required.