unsigned long int wcstoul (const wchar_t* str, wchar_t** endptr, int base);
Convert wide string to unsigned long integer
Parses the C wide string str interpreting its content as an integral number of the specified base, which is returned as an unsigned long int value.
This is the wide character equivalent of strtoul (<cstdlib>), interpreting str in the same way.
- C wide string containing the representation of an integral number.
- Reference to an object of type wchar_t*, whose value is set by the function to the next character in str after the numerical value.
This parameter can also be a null pointer, in which case it is not used.
On success, the function returns the converted integral number as an unsigned long int value.
If no valid conversion could be performed, a zero value is returned.
If the value read is out of the range of representable values by an unsigned long int, the function returns ULONG_MAX (defined in <climits>), and errno is set to ERANGE.
/* wcstoul example */
int main ()
wchar_t wsInput ;
unsigned long ul;
wprintf (L"Enter an unsigned number: ");
ul = wcstoul (wsInput,NULL,0);
wprintf (L"Value entered: %lu. Its double: %lu\n",ul,ul*2);
Enter an unsigned number: 25
Value entered: 25. Its double: 50
- Convert string to unsigned long integer (function
- Convert wide string to long integer (function
- Convert wide string to double (function