Skip to content

Commit 0774098

Browse files
authored
Merge pull request #4247 from stwish-msft/patch-11
Update scanf %c to mention field width
2 parents ceb17ec + 2a23af9 commit 0774098

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/c-runtime-library/scanf-type-field-characters.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ The `type` character is the only required format field; it appears after any opt
1414

1515
|Character|Type of input expected|Type of argument|Size argument in secure version?|
1616
|---------------|----------------------------|----------------------|--------------------------------------|
17-
|`c`|Character. When used with `scanf` functions, specifies single-byte character; when used with `wscanf` functions, specifies wide character. White-space characters that are ordinarily skipped are read when `c` is specified. To read next non-white-space single-byte character, use `%1s`; to read next non-white-space wide character, use `%1ws`.|Pointer to **`char`** when used with `scanf` functions, pointer to **`wchar_t`** when used with `wscanf` functions.|Required. Size does not include space for a null terminator.|
18-
|`C`|Opposite size character. When used with `scanf` functions, specifies wide character; when used with `wscanf` functions, specifies single-byte character. White-space characters that are ordinarily skipped are read when `C` is specified. To read next non-white-space single-byte character, use `%1s`; to read next non-white-space wide character, use `%1ws`.|Pointer to **`wchar_t`** when used with `scanf` functions, pointer to **`char`** when used with `wscanf` functions.|Required. Size argument does not include space for a null terminator.|
17+
|`c`|Character. When used with `scanf` functions, specifies single-byte character; when used with `wscanf` functions, specifies wide character. White-space characters that are ordinarily skipped are read when `c` is specified. Unlike with other type fields, the field width specifier indicates the exact number of characters, not the maximum. To read next non-white-space single-byte character, use `%1s`; to read next non-white-space wide character, use `%1ws`.|Pointer to **`char`** when used with `scanf` functions, pointer to **`wchar_t`** when used with `wscanf` functions.|Required. Size does not include space for a null terminator.|
18+
|`C`|Opposite size character. When used with `scanf` functions, specifies wide character; when used with `wscanf` functions, specifies single-byte character. White-space characters that are ordinarily skipped are read when `C` is specified. Unlike with other type fields, the field width specifier indicates the exact number of characters, not the maximum. To read next non-white-space single-byte character, use `%1s`; to read next non-white-space wide character, use `%1ws`.|Pointer to **`wchar_t`** when used with `scanf` functions, pointer to **`char`** when used with `wscanf` functions.|Required. Size argument does not include space for a null terminator.|
1919
|`d`|Decimal integer.|Pointer to **`int`**.|No.|
2020
|`i`|An integer. Hexadecimal if the input string begins with "0x" or "0X", octal if the string begins with "0", otherwise decimal.|Pointer to **`int`**.|No.|
2121
|`o`|Octal integer.|Pointer to **`int`**.|No.|

0 commit comments

Comments
 (0)