You can't do that with *num.
char *num = ""
declares a pointer to a string literal that is empty. What you need to realize is that this program structure limits the length of the string to exactly one character, the null character that terminates the string. Anything other than an empty string that's copied to where the pointer points will over flow into some other area and probably destroy what's there.
when you do
Quote: " strcat(txt, itoa(count, num, 10));"
you're overwriting the next area, the content of which isn't known unless you look at the compiled code, which could cause the program to misstep during runtime.
If you want to reserve more room you can do something like
char *num = " ";
with enough spaces to accommodate the largest number of characters you expect to use. Or, you can declare the following
char num [25];
to reserve 25 character spaces
ACCCCCHHHHHHHH. Just realized you did the same thing with txt.
You assigned a literal string to txt. That fixes the length of the string and anything that you append to it overflows into other data area.
Lilith, Night Butterfly
I'm not a programmer but I play one in the office