CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

dec to hex conversion

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
ZZX
Guest







dec to hex conversion
PostPosted: Wed Apr 19, 2006 5:58 am     Reply with quote

can somebody suggest/post a quick/small ascii to hex or dec to hex conversion routine. Make sure it works for a 3 digit.
I can convert from hex to dec like this:
dec1= hex1/16 + '0';
dec2= hex2/16 + '0';

Id be grateful if somebody suggests the opposite i.e dec to hex but workable algo for a 3 digit value tooo.

ZZX
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Wed Apr 19, 2006 6:09 am     Reply with quote

Look in the manual for:

atoi()
atol()
atoi32()
STRTOUL()
printf()
Guest








PostPosted: Thu Apr 20, 2006 5:44 am     Reply with quote

Thank you for the hint.
Can you also specify if theres a function available for string to BCD conversion? Itll be a lot of help !
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Thu Apr 20, 2006 10:27 pm     Reply with quote

Search the board for BCD functions, You could also write one yourself.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group