Hacker News new | ask | show | jobs
by bno1 1462 days ago
The address of the nil byte + 1
1 comments

But isn't `""` 0 terminated? So the first offset past the nil byte is 0, interpreted as an address.
"" is empty, so ""[0] is the nil byte.

The code uses "" as an arbitrary address, and ""[1] as that address + 1.

This way this-"" gets you 1-based index into the array.

It assumes the compiler dedfuplicates strings, making the behavior of this program undefined.