Skip to content

Commit d13d8ae

Browse files
updates after review
1 parent 09c1ef4 commit d13d8ae

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docs/c-runtime-library/reference/strtol-wcstol-strtol-l-wcstol-l.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ long _wcstol_l(
4747
Null-terminated string to convert.
4848

4949
*`end_ptr`*\
50-
An output parameter, set to point to the character after the last interpreted character. Ignored, if **NULL**.
50+
An output parameter, set to point to the character after the last interpreted character. Ignored, if **`NULL`**.
5151

5252
*`base`*\
5353
Number base to use.
@@ -57,23 +57,23 @@ Locale to use.
5757

5858
## Return Value
5959

60-
**`strtol`**, **`wcstol`**, **`_strtol_l`**, and **`_wcstol_l`** return the value represented in *`string`*. They return 0 if no conversion is possible. When the representation would cause an overflow, they return **`LONG_MAX`** or **`LONG_MIN`**.
60+
**`strtol`**, **`wcstol`**, **`_strtol_l`**, and **`_wcstol_l`** return the value represented in *`string`*. They return `0` if no conversion is possible. When the representation would cause an overflow, they return **`LONG_MAX`** or **`LONG_MIN`**.
6161

62-
**`errno`** is set to **`ERANGE`** if overflow or underflow occurs. It's set to **`EINVAL`** if *`string`* is **NULL**. Or, if *`base`* is nonzero and less than 2, or greater than 36. For more information on **`ERANGE`**, **`EINVAL`**, and other return codes, see [`_doserrno`, `errno`, `_sys_errlist`, and `_sys_nerr`](../../c-runtime-library/errno-doserrno-sys-errlist-and-sys-nerr.md).
62+
**`errno`** is set to **`ERANGE`** if overflow or underflow occurs. It's set to **`EINVAL`** if *`string`* is **`NULL`**. Or, if *`base`* is nonzero and less than `2`, or greater than `36`. For more information on **`ERANGE`**, **`EINVAL`**, and other return codes, see [`_doserrno`, `errno`, `_sys_errlist`, and `_sys_nerr`](../../c-runtime-library/errno-doserrno-sys-errlist-and-sys-nerr.md).
6363

6464
## Remarks
6565

6666
The **`strtol`**, **`wcstol`**, **`_strtol_l`**, and **`_wcstol_l`** functions convert *`string`* to a **`long`**. They stop reading *`string`* at the first character not recognized as part of a number. It may be the terminating-null character, or the first alphanumeric character greater than or equal to *`base`*.
6767

6868
**`wcstol`** and **`_wcstol_l`** are wide-character versions of **`strtol`** and **`_strtol_l`**. Their *`string`* argument is a wide-character string. These functions behave identically to **`strtol`** and **`_strtol_l`** otherwise. The locale's **`LC_NUMERIC`** category setting determines recognition of the radix character (the fractional marker or decimal point) in *`string`*. The functions **`strtol`** and **`wcstol`** use the current locale. **`_strtol_l`** and **`_wcstol_l`** use the locale passed in instead. For more information, see [`setlocale`] and [Locale](../../c-runtime-library/locale.md).
6969

70-
When *`end_ptr`* is **NULL**, it's ignored. Otherwise, a pointer to the character that stopped the scan is stored at the location pointed to by *`end_ptr`*. No conversion is possible if no valid digits are found, or an invalid base is specified. The value of *`string`* is then stored at the location pointed to by *`end_ptr`*.
70+
When *`end_ptr`* is **`NULL`**, it's ignored. Otherwise, a pointer to the character that stopped the scan is stored at the location pointed to by *`end_ptr`*. No conversion is possible if no valid digits are found, or an invalid base is specified. The value of *`string`* is then stored at the location pointed to by *`end_ptr`*.
7171

7272
**`strtol`** expects *`string`* to point to a string of the following form:
7373

7474
> [*whitespace*] [{**+** | **-**}] [**0** [{ **x** | **X** }]] [*alphanumerics*]
7575
76-
Square brackets (`[ ]`) surround optional elements. Curly braces and a vertical bar (`{ | }`) surround alternatives for a single element. *whitespace* may consist of space and tab characters, which are ignored. *alphanumerics* are decimal digits or the letters 'a' through 'z' (or 'A' through 'Z'). The first character that doesn't fit this form stops the scan. If *`base`* is between 2 and 36, then it's used as the base of the number. If *`base`* is 0, the initial characters of the string pointed to by *`string`* are used to determine the base. If the first character is 0, and the second character isn't 'x' or 'X', the string is interpreted as an octal integer. If the first character is '0' and the second character is 'x' or 'X', the string is interpreted as a hexadecimal integer. If the first character is '1' through '9', the string is interpreted as a decimal integer. The letters 'a' through 'z' (or 'A' through 'Z') are assigned the values 10 through 35. The scan only allows letters whose values are less than *`base`*. The first character outside the range of the base stops the scan. For example, suppose *`string`* starts with "01". If *`base`* is 0, the scanner assumes it's an octal integer. An '8' or '9' character stops the scan.
76+
Square brackets (`[ ]`) surround optional elements. Curly braces and a vertical bar (`{ | }`) surround alternatives for a single element. *whitespace* may consist of space and tab characters, which are ignored. *alphanumerics* are decimal digits or the letters `a` through `z` (or `A` through `Z`). The first character that doesn't fit this form stops the scan. If *`base`* is between `2` and `36`, then it's used as the base of the number. If *`base`* is `0`, the initial characters of the string pointed to by *`string`* are used to determine the base. If the first character is `0`, and the second character isn't `x` or `X`, the string is interpreted as an octal integer. If the first character is `0` and the second character is `x` or `X`, the string is interpreted as a hexadecimal integer. If the first character is `1` through `9`, the string is interpreted as a decimal integer. The letters `a` through `z` (or `A` through `Z`) are assigned the values `10` through `35`. The scan only allows letters whose values are less than *`base`*. The first character outside the range of the base stops the scan. For example, suppose *`string`* starts with `01`. If *`base`* is `0`, the scanner assumes it's an octal integer. An `8` or `9` character stops the scan.
7777

7878
By default, this function's global state is scoped to the application. To change this, see [Global state in the CRT](../global-state.md).
7979

0 commit comments

Comments
 (0)