Y
Hacker News
new
|
ask
|
show
|
jobs
by
richardwhiuk
2120 days ago
With the minor problem that `a[3]` isn't valid.
1 comments
edflsafoiewq
2120 days ago
Depends how you use it (&a[3], sizeof(a[3])). But its type is still char.
link
richardwhiuk
2111 days ago
IIRC, both of those are undefined.
link
edflsafoiewq
2104 days ago
&a[3] is allowed, it's a one-past-the-end-of-the-array pointer. &a[4] would be UB (if it were evaluated).
sizeof(a[3]) is not evaluating a[3], so it also isn't UB.
link