> For the complete documentation index, see [llms.txt](https://book.bsdcn.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://book.bsdcn.org/man/locale/wcstol.3.md).

# wcstol.3

`wcstol` — 将宽字符串值转换为 `long`、`unsigned long`、`long long`、`unsigned long long`、`intmax_t` 或 `uintmax_t` 整数

## 名称

`wcstol`, `wcstoll`, `wcstoimax`, `wcstoul`, `wcstoull`, `wcstoumax`

## 库

Lb libc

## 概要

`#include <wchar.h>`

`Ft long Fn wcstol const wchar_t * restrict nptr wchar_t ** restrict endptr int base Ft unsigned long Fn wcstoul const wchar_t * restrict nptr wchar_t ** restrict endptr int base Ft long long Fn wcstoll const wchar_t * restrict nptr wchar_t ** restrict endptr int base Ft unsigned long long Fn wcstoull const wchar_t * restrict nptr wchar_t ** restrict endptr int base`

`#include <inttypes.h>`

`Ft intmax_t Fn wcstoimax const wchar_t * restrict nptr wchar_t ** restrict endptr int base Ft uintmax_t Fn wcstoumax const wchar_t * restrict nptr wchar_t ** restrict endptr int base`

## 描述

`wcstol`、`wcstoul`、`wcstoll`、`wcstoull`、`wcstoimax` 和 `wcstoumax` 函数分别是 `strtol`、`strtoul`、`strtoll`、`strtoull`、`strtoimax` 和 `strtoumax` 函数的宽字符版本。详情请参阅它们的手册页（例如 [strtol(3)](https://github.com/FreeBSD-Ask/freebsd-man-sc/tree/main/locale/strtol.3.md)）。

## 参见

[strtol(3)](https://github.com/FreeBSD-Ask/freebsd-man-sc/tree/main/locale/strtol.3.md), [strtoul(3)](https://github.com/FreeBSD-Ask/freebsd-man-sc/tree/main/locale/strtoul.3.md)

## 标准

`wcstol`、`wcstoul`、`wcstoll`、`wcstoull`、`wcstoimax` 和 `wcstoumax` 函数遵循 ISO/IEC 9899:1999 ("ISO C99")。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://book.bsdcn.org/man/locale/wcstol.3.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
