A program performs undefined behavior in two ways, which means that the behavior of your program is unpredictable, even normal behavior is possible.
First, although we can treat individual elements of the structure as arrays after you increase the pointer, it is no longer suitable for dereferencing it, it should not even point to the next element, which it could well point to the upholstery.
Secondly, an attempt to change the constant also in undefined behavior. draft C ++ 7.1.6.1 Qualifying cv classifiers, which states:
[...] any attempt to change the const object during its lifetime (3.8) leads to undefined behavior.
We can see that for the purpose of pointer arithmetic, a variable without an array is considered as an array of one element from Section 5.7 Additive Operators, which states:
For the purposes of these operators, a pointer to a nonarray object behaves in the same way as a pointer to the first element of an array of length one with the type of the object as its element type.
and furthermore, splitting to one end of the end of the array is undefined behavior, from the same section:
When an expression with an integral type is added or subtracted from the pointer, the result has the type of the operand of the pointer. [...] If both the pointer operands and the result point to elements of the same array object or one after the last element of the array object, the evaluation should not lead to overflow; otherwise, the behavior is undefined.
we can see from Section 5.3.1 Unary operators that say:
The unary * operator performs an indirect direction: an expression to which it applies a pointer to the type of an object or a pointer to a type of a function and the result of an lvalue related to the object or Function
when we are looking for a pointer that we expect and an object that we do not guarantee when we are one after another.
The GNU C ++ library has easier access to an explanation that says (attention):
You can only dereference a pointer pointing to an array. If your array pointer points are outside the array - even to one end - and you look for it, Bad things.