In C, what is the most efficient way to convert a string of hex digits into a binary unsigned int or unsigned long?
unsigned int
unsigned long
For example, if I have
Try this:
#include int main() { char s[] = "fffffffe"; int x; sscanf(s, "%x", &x); printf("%u\n", x); }