HN
Hacker News
Top
New
Best
Ask
Show
Jobs
Comment by dependenttypes | Hacker News Reader
Parent
Full thread
dependenttypes
·
void f(size_t n, int v[n]) is valid C.
View on HN
Koshkin
·
Semantically though, the second argument is still just a naked pointer.
david2ndaccount
·
That’s why you use the proper declaration of
void f(size_t n, int (*v)[n])
instead.
dependenttypes
·
Is it? I am pretty sure that v[x] where x >= n is UB.
Reply on news.ycombinator.com