This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

strings in c51 v3.2

I'm using v3.2 of C51 and have some problems with strings.

I build a string using strcpy() and strcat(). It is easier to use sprintf() but, I tried to save code space by not using printf(). Sometimes everything seems OK, but sometimes -when I changed an irrelevant part of the code- programs crashes and tries to re-run main().

When I remove the code which is using the builded string, program is fixed and everything works fine. The removed code is string out code to the LCD which uses strlen() and buffer[i] byte access.

Sometimes, it works but string seems incomplete. All the strcpy() part is seen, but strcat() part is missing.

And, yes, I allocated enough space for the string.

I know that it seems unclear; but this is all I got.

Does anyone has any ideas?

0