3 ms·
How so? The pointer pointing past the last member of an array may not be dereferenced. Doing so is UB - end of story.
by cygx 14y ago
How so? The pointer pointing past the last member of an array may not be dereferenced. Doing so is UB - end of story.
- mnarayan01 14y agoAs I said, I'm to lazy too delve into the C89 spec (and too young to have actually programmed in the pre-VM days), but my (only slightly) educated guess is that on the type of machine/OS C89 would have been targeted at, any exceptions thrown by reading past the end of an array could be solved by adding more memory; the same solution as would be required if the array was increased in size.