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

conversion from long to ascii

Hey Guys, i am storing a number as a long in memory and need to convert it to an ascii number ie 123456789 to "123456789" been trying with :

sprintf(telno,"%u",123456789);

but what gets stored in telno is just [49,56,56,51,0,0,0,0,... which is "1883" which seems to be rubbish to me

here the code:

unsigned long xdata Telephone;
unsigned char xdata telno[16];
main () { Telephone = 123456789; sprintf(telno,"%u",Telephone);
}

thanx in advance

Xarion

0