Nov 27, 2007 #1 jjmcousineau Newbie level 6 Joined Feb 15, 2007 Messages 14 Helped 0 Reputation 0 Reaction score 0 Trophy points 1,281 Activity points 1,383 Hello, I would like some help converting a decimal number into a string of ASCII characters in C language. For Example d120 would become '1' '2' '0'. I am not a very good programmer and I cannot figure out how to go about separating each character. Thank you for your help. Jon
Hello, I would like some help converting a decimal number into a string of ASCII characters in C language. For Example d120 would become '1' '2' '0'. I am not a very good programmer and I cannot figure out how to go about separating each character. Thank you for your help. Jon
Nov 29, 2007 #2 D Darth Maul Junior Member level 1 Joined Jul 19, 2007 Messages 18 Helped 2 Reputation 4 Reaction score 0 Trophy points 1,281 Location Yogyakarta, Indonesia Activity points 1,436 Re: Decimal to ASCII there's a standard library function called itoa() that returns string for an integer argument. check out https://www.mkssoftware.com/docs/man3/itoa.3.asp. I hope this helps you.
Re: Decimal to ASCII there's a standard library function called itoa() that returns string for an integer argument. check out https://www.mkssoftware.com/docs/man3/itoa.3.asp. I hope this helps you.
Nov 29, 2007 #3 jjmcousineau Newbie level 6 Joined Feb 15, 2007 Messages 14 Helped 0 Reputation 0 Reaction score 0 Trophy points 1,281 Activity points 1,383 Re: Decimal to ASCII Thanks but I am using CCS for PIC and do not have that function available to me. Would you be able to tell me how it does that or of a function in ccs with that function? Thanks Jon
Re: Decimal to ASCII Thanks but I am using CCS for PIC and do not have that function available to me. Would you be able to tell me how it does that or of a function in ccs with that function? Thanks Jon
Nov 29, 2007 #4 A aajizattari Member level 3 Joined Nov 13, 2007 Messages 55 Helped 8 Reputation 16 Reaction score 0 Trophy points 1,286 Activity points 1,608 Decimal to ASCII You can Create a Function of Your Own for that You see you just need to add 48 decimal or 30h to convert a single digit from decimal to ascii character And in reverse you subtract 30h and for a Complete No, You Process it Digit by Digit To get a digit at a time use Remaiders and Quotients and Divide till you are DONE Hope U are to Click Helped Me with This Much
Decimal to ASCII You can Create a Function of Your Own for that You see you just need to add 48 decimal or 30h to convert a single digit from decimal to ascii character And in reverse you subtract 30h and for a Complete No, You Process it Digit by Digit To get a digit at a time use Remaiders and Quotients and Divide till you are DONE Hope U are to Click Helped Me with This Much