There should be no difference in terms of cost, it's just a difference in scope.
With the pointer defined outside the loop it will continue to be defined after the loop has run (and would contain a pointer to the last item enumerated if you break out of the loop) so you could reuse it for something else.
With the pointer inside the loop, the pointer is not accessible outside the loop.