I haven't analyzed the entire code, but just skimming by it quickly it appears that you are storing 5 characters into aa, and it can only hold 5 characters. Shouldn't it have a 6th character for the \0 termination? Otherwise, how do the functions know where the string ends?

Originally posted by thcc Is it possible 4 me 2 send u the source code and u debug 4 me?

No. Please read my reply one more time, and check your code to see if this is the problem. I am fairly sure that it is, since I am pretty sure %s requires a NULL terminated string. Check to make sure that this is what you are passing to it. If you cannot do this because you don't know enough about the functions you are using, then you should use MSDN to read up on them. If you don't know enough about the language to do this, then you should learn more about it from a tutorial. If I were to debug the code for you, all that does is waste my time, and you'll learn nothing. This does not benefit you in the long run.

That statement declares a pointer that points to NULL, meaning it doesn't point to anything. The NEXT statement makes it point to a NULL terminated string. In any case, this has nothing to do with your problem.

The aa array is too small to hold 5 characters plus a NULL termination character. You need one extra character for the NULL. So, make it hold 6 characters if you wish to store a string of 5 into it. This is what I stated in my frist reply. Have you tried this fix, yet? If not, please try it. I also think you need to find a C++ tutorial to learn more about the language. I can recommend a good book if you are interested.