Sorry, I wasn't asking a question for my edification. I was posing the question to you, so you could study your code, and realize that ptr was not pointing to where you intended.