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