Convert Hex(or any base) string to Int
8
Converts a string representation of a number with any base(binary, octal, decimal, hexadecimal, up to base 36) to a long int.
const char string[] = "0xDEADBEEF";
long hexNumber = strtol(string + 2, NULL, 16);






<manpage>
long
strtol(const char * restrict nptr, char ** restrict endptr, int base);
long long
strtoll(const char * restrict nptr, char ** restrict endptr, int base);
The strtol() function converts the string in nptr to a long value. The
strtoll() function converts the string in nptr to a long long value.
</manpage>
Oh, and here's my snippet for counting events:
I've got good news, and I've got bad news:
The universe is merely a figment of my imagination.
Now are you ready for the bad news?
int i = 0;
if(event) i++;
Bobby R Ward
---------------------
bobbyrward@gmail.com