Everything

wcstol / wcstoll / wcstoul / wcstoull


Converts the initial part of a wide string to a specified-type integer.

[Format]

#include <wchar.h>

long int wcstol(const wchar_t * restrict nptr, wchar_t ** restrict endptr, long base);

long long int wcstoll(const wchar_t * restrict nptr, wchar_t ** restrict endptr, long base);

unsigned long int wcstoul(const wchar_t * restrict nptr, wchar_t ** restrict endptr, long base);

unsigned long long int wcstoull(const wchar_t * restrict nptr, wchar_t ** restrict endptr, long base;

[Parameters]

nptr Pointer to a number-representing string to be converted

endptr Pointer to the storage area containing a pointer to the first character that does not represent an integer

base Radix of conversion (0 or 2 to 36)

[Return values]

Normal: f the string pointed by nptr begins with a character that does not represent an integer: 0

If the string pointed by nptr begins with a character that represents an integer: Converted data as a specified-type integer

Abnormal: If the converted data overflows: LONG_MIN, LONG_MAX, LLONG_MIN, LLONG_MAX, ULONG_MAX, or ULLONG_MAX depending on the sign of the string before conversion

[Remarks]

If the converted result overflows, errno is set.

The wcstol function group is the wide-character version of the strtol function group.