cybersecurity · beginner · ~15 min

Did every step succeed?

Aggregate the success of a sequence of calls.

Challenge

Implement int all_ok(const int *rcs, int n) returning 1 if all n return codes are >= 0, else 0 (fail-fast on the first error in a chain).

Starter code

int all_ok(const int *rcs, int n) {
    /* TODO */
    return 0;
}

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