char arr = "Hello";
arr = arr + 1; // error occurs
arr = arr + 1
arr + 1 is indeed a pointer to the second element of the array (i.e.
However, that does not mean that you can somehow write that pointer value back into
arr. You can't do it for at least two reasons. Firstly,
arr is an array of
char elements, not a pointer. Secondly, being an array,
arr a non-modifiable lvalue. You cannot change
In other words, it is not the "pointer arithmetic" that disallowed here. The pointer arithmetic is fine. It is what you do with the result of that pointer arithmetic that causes the error.