by ucs · 10y ago · 0 comments
I really like the idiom for passing sized arrays suggested at the end of that LKML thread[1]: pass them by reference!
void func(int (*arr)[256])
{
printf("arr size: %ld\n", sizeof(*arr));
}
int main(void)
{
int array[256];
func(&array);
}
[1] https://lkml.org/lkml/2015/9/7/147No comments yet.