Thursday, November 25, 2010

The strtoull() Function

The value of strtoull("15", 0 , 16) is 21.

strtoull() converts a string to an integer. In the case above, the string is interpreted as base 16. So 15 maps to (1*16) + 5*1 = 21. There are several strtoxxx()-like functions, here are some: atoi, atol, atoll, strtol, strtod

Reference: http://www.cplusplus.com/reference/clibrary/cstdlib/strtoul.html

No comments:

Post a Comment