3 ms·
But isn't `""` 0 terminated? So the first offset past the nil byte is 0, interpreted as an address.
by jessermeyer 4y ago
But isn't `""` 0 terminated? So the first offset past the nil byte is 0, interpreted as an address.
- oldgradstudent 4y ago"" 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.