Question

Need to make int from hex representation string like "0xFA" or better "FA". Need something like atoi("FA"). Is there are any standard solutions for that?

Was it helpful?

Solution

Try to use strtol():

strtol("FA", NULL, 16);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top