But you're not using the offset to compute the index in bar().
void foo(int offset, int *arr) {
for(int i = offset; i < (offset + 16); i++) {
arr[i] = i + 32;
}
}
If you call this with offset = 100, the arr[i] in the loop will write to arr[100], arr[101], ..., arr[115].
void bar(unsigned int offset, int *arr) {
if(offset+16 < offset)fail();
for(size_t i = 0; i < 16; i++) {
arr[i] = i+ offset + 32;
}
}
If you call this with offset = 100, the arr[i] in the loop will write to arr[0], arr[1], ..., arr[15].