Practice ยท 3 of 4
Bounds-Checked Access
CHALLENGE
Difficulty: advanced+25 XP
Implement int checked_get(const int *a, size_t n, size_t i, int *out) returning 0 and writing *out on success, returning -1 without writing on out-of-range or NULL โ then int checked_sum(const int *a, size_t n) summing via checked_get (a NULL array with n>0 must sum to 0 with -1 per element).
Press Submit to check your solution.
Back to lesson: Practice: Detection Drills