Hacker News new | ask | show | jobs
by ynik 52 days ago
In C there's only two operations you can do with arrays that do not decay to a pointer: `sizeof(array_var)` and `&array_var`. The latter produces a rarely-seen "pointer to array", i.e. a type like `int (*)[10]` (pointer-to-array syntax works like pointer-to-function syntax).
1 comments

Luckily I start to see such pointers used more often, because such pointers can be used for bounds checking because the size is preserved in the type.