If you have changed vals to vals (vals is an error) and keep the sentence *ptr++=0 in your original program, it seems to will not terminate ifself. I have not practised it. If you will try it, please let me know the result. If it terminte itself, I misunderstand something and I will learn some from my misunderstanding. Thank you!