There are many problems here
z
is a local variable int.
its address will not be useful to return, because it will be out of scope.
returning an offset from its address is even worse, since that is a totally unrelated place in memory.
you also have an off-by-one error. imagine Number elements is one. You will then try to view ptr+1 instead of ptr+0.
you’ve also tagged this c++ but are writing c style code.
to answer your primary question, rather than writing ReverResult=(z+rever)
one could write *(ReverResult + rever - 1) = *(ptr + i)
2
solved convert int to pointer int *ptr position;