arr++ is attempting to increment the array. You can't do that.
The fact that the name of an array can be used like a pointer
to access an array does not mean that the name of the array is
a pointer. It "decays" - is translated into by the compiler - a
pointer, in some contexts.
You appear to be struggling with the concepts of arrays and pointers, as
used in the C language (and inherited by C++). I strongly suggest that
you spend as much time as needed to study the available tutorials and
documentation on pointers and arrays, Otherwise you will be coming back
to these forums repeatedly asking why your code doesn't work as expected.
A TUTORIAL ON POINTERS AND ARRAYS IN C
https://pdos.csail.mit.edu/6.828/2014/readings/pointers.pdf
Relationship Between Arrays and Pointers
https://www.programiz.com/c-programming/c-pointers-arrays
6.8 — Pointers and arrays
https://www.learncpp.com/cpp-tutorial/6-8-pointers-and-arrays/
Exceptions to array decaying into a pointer?
https://stackoverflow.com/questions/17752978/exceptions-to-array-decaying-into-a-pointer
Pointer to an Array in C
https://www.tutorialspoint.com/cprogramming/c_pointer_to_an_array.htm
6. Arrays and Pointers
http://c-faq.com/aryptr/index.html
comp.lang.c FAQ list · Question 6.12
http://c-faq.com/aryptr/aryvsadr.html
comp.lang.c FAQ list · Question 6.13
http://c-faq.com/aryptr/ptrtoarray.html
- Wayne