5 ms·
void f(size_t n, int v[n]) is valid C.
by dependenttypes 6y ago
void f(size_t n, int v[n]) is valid C.
- Koshkin 6y agoSemantically though, the second argument is still just a naked pointer.
- david2ndaccount 6y agoThat’s why you use the proper declaration of void f(size_t n, int (*v)[n]) instead.
- dependenttypes 6y agoIs it? I am pretty sure that v[x] where x >= n is UB.