I have a string that has 0111111100000000000000000000101
I wanted to convert this to hex, so I used the code below
int assembledHex;
sscanf(buffer, "%x", &assembledHex);
printf("this is the assembled hex %x\n",assembledHex);
but when I print it, it gives me 101. I thought sscanf can convert to hex from a string, what am I doing wrong and how can I fix it. The result I want is 0x3F800005
This is not checked or anything, and also quite slow, but it’s a quick start: