The value used in my project is expressed with 4-bits binary coded decimals (BCD), which was originally stored in a character buffer (for example, pointed by a pointer const unsigned char *
). I want to convert the input BCD char stream to an integer. Would you please show me an efficient and fast way to do that?
Data format example and expected result:
BCD*2; 1001 0111 0110 0101=9765
"9" "7" "6" "5"
Thank you very much!