Is incrementing a pointer to a 0-sized dynamic array undefined?
Pointers to elements of arrays are allowed to point to a valid element, or one past the end. If you increment a pointer in a way that goes more than one past the end, the behavior is undefined. For your 0-sized array, p is already pointing one past the end, so incrementing it is not … Read more