Dehogynem fogja, csak kell bele egy throw
Ha már C++, akkor legyen C++.
C-ben meg így:
int get_element_safe(uint32_t *arr,size_t idx,uint32_t *element)
{
if (idx >= SIZE)
return -1;
if (element)
*element=arr[idx];
return 0;
}