pointers-memory · beginner · ~15 min
Verify a buffer is zeroed.
Implement int all_zero(const int *a, int n) returning 1 if every one of the first n elements is 0, else 0.
int all_zero(const int *a, int n) {
/* TODO */
return 0;
}
Solve this exercise in the browser editor — compile and run against the test harness, no setup required.