| ??? 05/02/02 20:37 Read: times |
#22427 - Memory & strings; AT89C51 |
I'm using the Tasking evaluation C compiler, and I'm having some trouble trying to convert a number into a string using the sprintf() function. It keeps giving me memory space errors, and I don't understand how to correct it.
This is the code I'm trying to work with right now: char numstr; unsigned long num = 500; sprintf( numstr, "%lu", num ); The desired result is to create a string that looks like "500" so I can print the data to the serial port as a string. Can anybody point out what I'm doing wrong here? I'm getting pretty frustrated. Thanks in advance |



