---
name: "wcstol"
section: "3"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["freebsd", "macos"]
url: "https://new.carta.tech/wcstoimax"
---

# wcstol(3)

convert a wide character string value to a long, unsigned long, long long, unsigned long long, intmax\_t or uintmax\_t integer

Part of [wcstoimax(3)](/wcstoimax/3.md).

## NAME

**wcstol**, **wcstoul**, **wcstoll**, **wcstoull**, **wcstoimax**, **wcstoumax** – convert a wide character string value to a *long*, *unsigned long*, *long long*, *unsigned long long*, *intmax\_t* or *uintmax\_t* integer

## LIBRARY

Standard C Library (libc, -lc)

## SYNOPSIS

**#include \<wchar.h\>**

*long*\

**wcstol**(*const wchar\_t \* restrict nptr*, *wchar\_t \*\* restrict endptr*, *int base*);

*unsigned long*\

**wcstoul**(*const wchar\_t \* restrict nptr*, *wchar\_t \*\* restrict endptr*, *int base*);

*long long*\

**wcstoll**(*const wchar\_t \* restrict nptr*, *wchar\_t \*\* restrict endptr*, *int base*);

*unsigned long long*\

**wcstoull**(*const wchar\_t \* restrict nptr*, *wchar\_t \*\* restrict endptr*, *int base*);

**#include \<inttypes.h\>**

*intmax\_t*\

**wcstoimax**(*const wchar\_t \* restrict nptr*, *wchar\_t \*\* restrict endptr*, *int base*);

*uintmax\_t*\

**wcstoumax**(*const wchar\_t \* restrict nptr*, *wchar\_t \*\* restrict endptr*, *int base*);

## DESCRIPTION

The **wcstol**(), **wcstoul**(), **wcstoll**(), **wcstoull**(), **wcstoimax**() and **wcstoumax**() functions are wide-character versions of the **strtol**(), **strtoul**(), **strtoll**(), **strtoull**(), **strtoimax**() and **strtoumax**() functions, respectively. Refer to their manual pages (for example [strtol(3)](/strtol/3.md)) for details.

## SEE ALSO

[strtol(3)](/strtol/3.md), [strtoul(3)](/strtoul/3.md)

## STANDARDS

The **wcstol**(), **wcstoul**(), **wcstoll**(), **wcstoull**(), **wcstoimax**() and **wcstoumax**() functions conform to ISO/IEC 9899:1999 (“ISO C99”).
