A pointer to a read-only wide-character string, where each character is of type `wchar_t`. Used for representing text in wide-character encoding to support extended character sets, such as Unicode. The string is null-terminated, with the terminator being a `wchar_t` with value 0.
1st Parameter
Pointer to the null-terminated wide-character string to be converted.
Pointer to a pointer to a wide character. It is set to the character in `nptr` where the conversion stopped.
3rd Parameter Type : int
Integer type (typically 4 bytes, -2,147,483,648 to 2,147,483,647)
3rd Parameter
The base of the number to be converted (e.g., 10 for decimal, 16 for hexadecimal). If 0, the base is automatically determined from the string format.
Read more about parameters of wcstoul in parameters section
The wcstoulfunction in C language Converts the initial portion of a wide character string to an unsigned long integer.
wcstoul converts the initial portion of the wide-character string pointed to by nptr to an unsigned long integer representation. It skips leading whitespace, recognizes an optional plus or minus sign, and converts the subsequent sequence of digits. The conversion is done according to the given base, which must be between 2 and 36 inclusive, or be the special value 0.
The wcstoulfunction takes 3
parameters:
•
const wchar_t * `nptr`: Pointer to the null-terminated wide-character string to be converted.
•
wchar_t ** `endptr`: Pointer to a pointer to a wide character. It is set to the character in `nptr` where the conversion stopped.
•
int `base`: The base of the number to be converted (e.g., 10 for decimal, 16 for hexadecimal). If 0, the base is automatically determined from the string format.
Converts the initial part of the wide-character string `nptr` to an `unsigned long` integer value according to the given `base`. If `endptr` is not `NULL`, it points to the first character after the number that was converted.
The wcstoul function return value :
Returns the converted value, if any
If no conversion could be performed, 0 is returned
If the correct value is outside the range of representable values, ULONG_MAX is returned, and errno is set to ERANGE
Output
This example demonstrates the basic usage of wcstoul to convert a wide string to an unsigned long integer.