Hi,
yesterday I've upgraded my version of CCs to version 6. I loaded my old programs compiled with version 4, but I have some problems with function sprintf.
Basically I have to send out to an external lcd display a string which contains a float value. I defined
float MY_VALUE //float value to be sent
unsigned char MY_STRING[30] // string to be filled with float value.
This 2 variables are contained in only one struct definition with other parameters not so important for this purpose.
Then I wrote sprintf
sprintf(MY_STRING, "%5.1f", MY_VALUE);
I imagine that MY_STRING content should be the exact trascription number by number of float value (right?), but that's the point! I don't find this... In debug mode I find that MY_STRING contains at second position the value "f" followed by (maybe) other unpredictible or non sense values from conversion.
I read a previous post in which TIer have suggested to install a previous version of Compiler. Is this the solution also for my case?
Thanks in advance...
Marco