Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Help me convert a decimal number to ASCII string in C language

Status
Not open for further replies.

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
 

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
 

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
 

    jjmcousineau

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top