arrays - Convert a hexadecimal to a float and viceversa in C - Stack Overflow

PHOTO EMBED

Tue Nov 15 2022 00:54:02 GMT+0000 (Coordinated Universal Time)

Saved by @leawoliu #c

int char_to_int(char c) {
   if (c >= '0' && c <= '9') return c - '0';
   if (c >= 'A' && c <= 'F') return c - 'A' + 10;
   return 0; /* oops, something else... */
}
content_copyCOPY

https://stackoverflow.com/questions/21323099/convert-a-hexadecimal-to-a-float-and-viceversa-in-c