25 ms·
> How do you specify a fast readonly array in C? Generally in the function declaration rather than the variable declaration, but to declare a non-aliasing poin
by smitherfield 9y ago
> How do you specify a fast readonly array in C?
Generally in the function declaration rather than the variable declaration, but to declare a non-aliasing pointer to array of constant ints would be
const int (restrict *my_array)[N];
or
int const (*restrict my_array)[N];
and the other two variations thereof.
- int_19h 9y agoGentle reminder to future language designers: whatever else you decide to take from C, please, please don't take declarator syntax. This thread showcases why.