Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
dependenttypes
· 6y ago · 0 comments
void f(size_t n, int v[n]) is valid C.
Comments
[–]
Koshkin
6y ago
Semantically though, the second argument is still just a naked pointer.
[–]
david2ndaccount
6y ago
That’s why you use the proper declaration of
void f(size_t n, int (*v)[n])
instead.
[–]
dependenttypes
OP
6y ago
Is it? I am pretty sure that v[x] where x >= n is UB.