c++ - Converting a string representing binary to a string representing equivalent hex -


so have string x = "10101" , need put string y hex value of binary in x. if x="10101" y="0x15"

i don't want provide complete answer.

that said, basic idea should fill start of string 3 zero's can split string substrings length of 4. can turned hex variety of ways, easiest being using switch case statement. there 16 cases'


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -