pointers-memory · intermediate · ~15 min
Use pointer increment and two-pointer ranges (like C++ iterators).
Implement long sum_walk(const int *begin, const int *end) that sums ints in the half-open range [begin, end). Walk via pointer arithmetic — do not take a separate length.
#include <stddef.h>
long sum_walk(const int *begin, const int *end) {
/* TODO */
return 0;
}
Solve this exercise in the browser editor — compile and run against the test harness, no setup required.