Browse - Programming Tips - How can I convert a string holding a hex number to an int?

Date: 2012jun18
Language: C/C++
Keywords: hexadecimal

Q.  How can I convert a string holding a hex number to an int?

A.

int number = strtol(str, NULL, 16);