Update reverse() and itoa() function to using pointer