| ??? 05/03/02 08:45 Read: times |
#22453 - RE: ASCII or Binary? |
"Can somebody tell me how to correct my code to send a pointer instead of the string? "
Yes! Your original code: char numstr; // numstr is a single character unsigned long num = 500; sprintf( numstr, "%lu", num ); // numstr here is a single character;Corrected Code: char numstr[LENGTH]; // numstr is an array of LENGTH characters unsigned long num = 500; sprintf( numstr, "%lu", num );// numstr points to the 1st character in numstr[]ie, as Craig said, make numstr an Array, so that its name used alone is a pointer! "I'm not very good at dealing with pointers." Pointers are fundamental to the 'C' language - you need to get a good book on 'C' and swot-up on them! "Thanks, I guess I'll have to take a look at the Keil compiler." It's a 'C' language issue, not a compiler issue! |



