networking · beginner · ~15 min

Did bind succeed?

Interpret bind()'s 0/-1 return.

Challenge

Implement int bind_succeeded(int rc) returning 1 if rc == 0 (success), else 0.

Starter code

int bind_succeeded(int rc) {
    /* TODO */
    return 0;
}

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