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

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -