??? 05/11/08 15:05 Read: times |
#154686 - Converting integers to strings Responding to: ???'s previous message |
Raghu said:
The funny part is I have been using this code which works fine: sprintf ( string, " Elapsed Time: %02U Sec. ", ElapsTime); display (string);And I just wanted to knock off the huge sprintf liability !! Well, that shows that ElapsTime is just an integer and you need to convert it to a string before you can display it. Your modified program (that doesn't use sprintf()) doesn't do this, so even if everything else was working correctly, you'd still get garbage in the display where the actual time was supposed to appear. Chris Bertrand was having similar troubles just a few days ago. Check out this thread for some further hints. -- Russ |
Topic | Author | Date |
LCD message format with strcat | 01/01/70 00:00 | |
Pointers in 8051 | 01/01/70 00:00 | |
Managed pointers.... | 01/01/70 00:00 | |
Hmmm.... | 01/01/70 00:00 | |
Ha Ha Ha.... | 01/01/70 00:00 | |
Hmmm, indeed | 01/01/70 00:00 | |
MK is right about the italics.. | 01/01/70 00:00 | |
You (and MK) are right! | 01/01/70 00:00 | |
Another Problem You Have... | 01/01/70 00:00 | |
I actually did not want a sprintf .. | 01/01/70 00:00 | |
Converting integers to strings | 01/01/70 00:00 | |
Getting better but not there still | 01/01/70 00:00 | |
Yet another problem | 01/01/70 00:00 | |
But I am concenating into DispMsg. | 01/01/70 00:00 | |
No you're not ???![]() | 01/01/70 00:00 |