
Repair at_or_default so it returns a[i] when i is an index of a and fallback in every other case.
at_or_default({10, 20, 30, 40, 50}, 5, 2, -1)30at_or_default({10, 20, 30, 40, 50}, 5, -1, 777)777at_or_default({10, 20, 30, 40, 50}, 3, 3, -1)-1at_or_default(NULL, 0, 3, 1234)1234index_guard.c<stddef.h>defines size_t
Run the tests to grade your code
Repair at_or_default so it returns a[i] when i is an index of a and fallback in every other case.
at_or_default({10, 20, 30, 40, 50}, 5, 2, -1)30at_or_default({10, 20, 30, 40, 50}, 5, -1, 777)777at_or_default({10, 20, 30, 40, 50}, 3, 3, -1)-1at_or_default(NULL, 0, 3, 1234)1234index_guard.c<stddef.h>defines size_t
Run the tests to grade your code
Memory will appear here