c - Store 8 Ascii Values in unsigned int -
i have query. have string of ascii value . reading hex file. consider string "0004eb9c" . copied in unsigned char buffer.
unsigned char buff[8] = {'0','0','0','4','e','b','9','c'} unsigned int j = 0;
now string or information has transmitted through uart communication. consider represents ram address execution. need store 8 byte ascii value in in unsigned int . not finding way can 1 please focus on this. output after copying/converting string should like
printf("%x",j);
this should print
output : 0x0004eb9c
thanks in advance!!
set answer 0 each character left-shift answer 4 if character between '0' , '9' inclusive subtract '0' else subtract 'a' , add 10 bitwise-or answer
Comments
Post a Comment