Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
05/02/03 17:57
Read: times


 
#44704 - RE: C bin/hex to Ascii Converion
Responding to: ???'s previous message
The routine below will seperate your byte into the three chars ..
so if value = FF

lsd=5
midd=5
msd=2


<html>
void display_byte(unsigned char  value) {


  unsigned char lsd;//least significant digit
  unsigned char midd;
  unsigned char msd;//most s. d. 
 
    lsd=value%10;
    value /=10;
    midd=value%10;
    value /=10;
    msd=value%10;
    
}
</html>

if you want to convert to ascii ,just add '0' or 0x30

hope this helps :-]

List of 20 messages in thread
TopicAuthorDate
C bin/hex to Ascii Converion            01/01/70 00:00      
   RE: C bin/hex to Ascii Converion            01/01/70 00:00      
   RE: C bin/hex to Ascii Converion            01/01/70 00:00      
      RE: C bin/hex to Ascii Converion            01/01/70 00:00      
   RE: C bin/hex to Ascii Converion            01/01/70 00:00      
      RE: C bin/hex to Ascii Converion            01/01/70 00:00      
         RE: C bin/hex to Ascii Converion            01/01/70 00:00      
            RE: C bin/hex to Ascii Converion            01/01/70 00:00      
               RE: C bin/hex to Ascii Converion            01/01/70 00:00      
   RE: C bin/hex to Ascii Converion            01/01/70 00:00      
   RE: C bin/hex to Ascii Converion            01/01/70 00:00      
      RE: C bin/hex to Ascii Converion            01/01/70 00:00      
         RE: C bin/hex to Ascii Converion            01/01/70 00:00      
         RE: C bin/hex to Ascii Converion            01/01/70 00:00      
   RE: C bin/hex to Ascii Converion            01/01/70 00:00      
      RE: C bin/hex to Ascii Converion            01/01/70 00:00      
         RE: C bin/hex to Ascii Converion            01/01/70 00:00      
         RE: C bin/hex to Ascii - (C)rude            01/01/70 00:00      
   RE: C bin/hex to Ascii Converion            01/01/70 00:00      
      RE: C bin/hex to Ascii Converion            01/01/70 00:00      

Back to Subject List