Y
Hacker News
new
|
ask
|
show
|
jobs
by
hoseja
1459 days ago
The evilest way to write `nullptr`.
1 comments
shultays
1459 days ago
it is not nullptr, it is address past \0 in "", which is an invalid address
link
3836293648
1459 days ago
No, the address itself is not invalid, you're just not allowed to dereference it. Pointers have to point at a valid object
or
, in the case of arrays,
one past
the end of the array. It's what `std::end` returns
link
hoseja
1459 days ago
Hence, evilest. (It got me.)
link