You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The test result of each `_ismbc` routine depends on the multibyte code page in effect. Multibyte code pages have single-byte alphabetic characters. By default, the multibyte code page is set to the system-default ANSI code page obtained from the operating system at program startup. You can query or change the multibyte code page in use with [`_getmbcp`](./reference/getmbcp.md) or [`_setmbcp`](./reference/setmbcp.md), respectively.
20
+
The test result of each `_ismbc` routine depends on the multibyte code page in effect. Multibyte code pages have single-byte alphabetic characters. By default, the multibyte code page is set to the system-default ANSI code page obtained from the operating system at program startup. You can query or change the multibyte code page in use with [`_getmbcp`](reference/getmbcp.md) or [`_setmbcp`](reference/setmbcp.md), respectively.
21
21
22
-
The output value is affected by the `LC_CTYPE` category setting of the locale. For more information, see [`setlocale`](./reference/setlocale-wsetlocale.md). The versions of these functions without the `_l` suffix use the current locale for this locale-dependent behavior; the versions with the `_l` suffix are identical except that they use the locale parameter passed in instead.
22
+
The output value is affected by the `LC_CTYPE` category setting of the locale. For more information, see [`setlocale`](reference/setlocale-wsetlocale.md). The versions of these functions without the `_l` suffix use the current locale for this locale-dependent behavior; the versions with the `_l` suffix are identical except that they use the locale parameter passed in instead.
23
23
24
24
| Routine | Test condition | Code page 932 example |
25
25
|---|---|---|
26
-
|[`_ismbcalnum`, `_ismbcalnum_l`](./reference/ismbcalnum-functions.md)| Alphanumeric | Returns nonzero if and only if `c` is a single-byte representation of an ASCII English letter: See examples for `_ismbcdigit` and `_ismbcalpha`. |
27
-
|[`_ismbcalpha`, `_ismbcalpha_l`](./reference/ismbcalnum-functions.md)| Alphabetic | Returns nonzero if and only if `c` is a single-byte representation of an ASCII English letter: See examples for `_ismbcupper` and `_ismbclower`; or a katakana letter: 0xA6<=`c`<=0xDF. |
28
-
|[`_ismbcdigit`, `_ismbcdigit_l`](./reference/ismbcalnum-functions.md)| Digit | Returns nonzero if and only if `c` is a single-byte representation of an ASCII digit: 0x30<=`c`<=0x39. |
29
-
|[`_ismbcgraph`, `_ismbcgraph_l`](./reference/ismbcgraph-functions.md)| Graphic | Returns nonzero if and only if `c` is a single-byte representation of any ASCII or katakana printable character except a white space ( ). See examples for `_ismbcdigit`, `_ismbcalpha`, and `_ismbcpunct`. |
30
-
|[`_ismbclegal`, `_ismbclegal_l`](./reference/ismbclegal-ismbclegal-l-ismbcsymbol-ismbcsymbol-l.md)| Valid multibyte character | Returns nonzero if and only if the first byte of `c` is within ranges 0x81 - 0x9F or 0xE0 - 0xFC, while the second byte is within ranges 0x40 - 0x7E or 0x80 - FC. |
31
-
|[`_ismbclower`, `_ismbclower_l`](./reference/ismbclower-ismbclower-l-ismbcupper-ismbcupper-l.md)| Lowercase alphabetic | Returns nonzero if and only if `c` is a single-byte representation of an ASCII lowercase English letter: 0x61<=`c`<=0x7A. |
32
-
|[`_ismbcprint`, `_ismbcprint_l`](./reference/ismbcgraph-functions.md)| Printable | Returns nonzero if and only if `c` is a single-byte representation of any ASCII or katakana printable character including a white space ( ): See examples for `_ismbcspace`, `_ismbcdigit`, `_ismbcalpha`, and `_ismbcpunct`. |
33
-
|[`_ismbcpunct`, `_ismbcpunct_l`](./reference/ismbcgraph-functions.md)| Punctuation | Returns nonzero if and only if `c` is a single-byte representation of any ASCII or katakana punctuation character. |
34
-
|[`_ismbcblank`, `_ismbcblank_l`](./reference/ismbcgraph-functions.md)| Space or horizontal tab | Returns nonzero if and only if `c` is a single-byte representation of a space character or a horizontal tab character: `c`=0x20 or `c`=0x09. |
35
-
|[`_ismbcspace`, `_ismbcspace_l`](./reference/ismbcgraph-functions.md)| Whitespace | Returns nonzero if and only if `c` is a white space character: `c`=0x20 or 0x09<=`c`<=0x0D. |
36
-
|[`_ismbcsymbol`, `_ismbcsymbol_l`](./reference/ismbclegal-ismbclegal-l-ismbcsymbol-ismbcsymbol-l.md)| Multibyte symbol | Returns nonzero if and only if 0x8141<=`c`<=0x81AC. |
37
-
|[`_ismbcupper`, `_ismbcupper_l`](./reference/ismbclower-ismbclower-l-ismbcupper-ismbcupper-l.md)| Uppercase alphabetic | Returns nonzero if and only if `c` is a single-byte representation of an ASCII uppercase English letter: 0x41<=`c`<=0x5A. |
26
+
|[`_ismbcalnum`, `_ismbcalnum_l`](reference/ismbcalnum-functions.md)| Alphanumeric | Returns nonzero if and only if `c` is a single-byte representation of an ASCII English letter: See examples for `_ismbcdigit` and `_ismbcalpha`. |
27
+
|[`_ismbcalpha`, `_ismbcalpha_l`](reference/ismbcalnum-functions.md)| Alphabetic | Returns nonzero if and only if `c` is a single-byte representation of an ASCII English letter: See examples for `_ismbcupper` and `_ismbclower`; or a katakana letter: 0xA6<=`c`<=0xDF. |
28
+
|[`_ismbcdigit`, `_ismbcdigit_l`](reference/ismbcalnum-functions.md)| Digit | Returns nonzero if and only if `c` is a single-byte representation of an ASCII digit: 0x30<=`c`<=0x39. |
29
+
|[`_ismbcgraph`, `_ismbcgraph_l`](reference/ismbcgraph-functions.md)| Graphic | Returns nonzero if and only if `c` is a single-byte representation of any ASCII or katakana printable character except a white space ( ). See examples for `_ismbcdigit`, `_ismbcalpha`, and `_ismbcpunct`. |
30
+
|[`_ismbclegal`, `_ismbclegal_l`](reference/ismbclegal-ismbclegal-l-ismbcsymbol-ismbcsymbol-l.md)| Valid multibyte character | Returns nonzero if and only if the first byte of `c` is within ranges 0x81 - 0x9F or 0xE0 - 0xFC, while the second byte is within ranges 0x40 - 0x7E or 0x80 - FC. |
31
+
|[`_ismbclower`, `_ismbclower_l`](reference/ismbclower-ismbclower-l-ismbcupper-ismbcupper-l.md)| Lowercase alphabetic | Returns nonzero if and only if `c` is a single-byte representation of an ASCII lowercase English letter: 0x61<=`c`<=0x7A. |
32
+
|[`_ismbcprint`, `_ismbcprint_l`](reference/ismbcgraph-functions.md)| Printable | Returns nonzero if and only if `c` is a single-byte representation of any ASCII or katakana printable character including a white space ( ): See examples for `_ismbcspace`, `_ismbcdigit`, `_ismbcalpha`, and `_ismbcpunct`. |
33
+
|[`_ismbcpunct`, `_ismbcpunct_l`](reference/ismbcgraph-functions.md)| Punctuation | Returns nonzero if and only if `c` is a single-byte representation of any ASCII or katakana punctuation character. |
34
+
|[`_ismbcblank`, `_ismbcblank_l`](reference/ismbcgraph-functions.md)| Space or horizontal tab | Returns nonzero if and only if `c` is a single-byte representation of a space character or a horizontal tab character: `c`=0x20 or `c`=0x09. |
35
+
|[`_ismbcspace`, `_ismbcspace_l`](reference/ismbcgraph-functions.md)| Whitespace | Returns nonzero if and only if `c` is a white space character: `c`=0x20 or 0x09<=`c`<=0x0D. |
36
+
|[`_ismbcsymbol`, `_ismbcsymbol_l`](reference/ismbclegal-ismbclegal-l-ismbcsymbol-ismbcsymbol-l.md)| Multibyte symbol | Returns nonzero if and only if 0x8141<=`c`<=0x81AC. |
37
+
|[`_ismbcupper`, `_ismbcupper_l`](reference/ismbclower-ismbclower-l-ismbcupper-ismbcupper-l.md)| Uppercase alphabetic | Returns nonzero if and only if `c` is a single-byte representation of an ASCII uppercase English letter: 0x41<=`c`<=0x5A. |
38
38
39
39
**Code Page 932 Specific**
40
40
41
41
The following routines are specific to code page 932.
|[`_ismbcl0`, `_ismbcl0_l`](reference/ismbcl0-ismbcl0-l-ismbcl1-ismbcl1-l-ismbcl2-ismbcl2-l.md)| JIS non-Kanji: 0x8140<=`c`<=0x889E. |
48
+
|[`_ismbcl1`, `_ismbcl1_l`](reference/ismbcl0-ismbcl0-l-ismbcl1-ismbcl1-l-ismbcl2-ismbcl2-l.md)| JIS level-1: 0x889F<=`c`<=0x9872. |
49
+
|[`_ismbcl2`, `_ismbcl2_l`](reference/ismbcl0-ismbcl0-l-ismbcl1-ismbcl1-l-ismbcl2-ismbcl2-l.md)| JIS level-2: 0x989F<=`c`<=0xEA9E. |
50
50
51
-
`_ismbcl0`, `_ismbcl1`, and `_ismbcl2` check that the specified value `c` matches the test conditions described in the preceding table, but don't check that `c` is a valid multibyte character. If the lower byte is in the ranges 0x00 - 0x3F, 0x7F, or 0xFD - 0xFF, these functions return a nonzero value, indicating that the character satisfies the test condition. Use [`_ismbbtrail`, `_ismbbtrail_l`](./reference/ismbbtrail-ismbbtrail-l.md) to test whether the multibyte character is defined.
51
+
`_ismbcl0`, `_ismbcl1`, and `_ismbcl2` check that the specified value `c` matches the test conditions described in the preceding table, but don't check that `c` is a valid multibyte character. If the lower byte is in the ranges 0x00 - 0x3F, 0x7F, or 0xFD - 0xFF, these functions return a nonzero value, indicating that the character satisfies the test condition. Use [`_ismbbtrail`, `_ismbbtrail_l`](reference/ismbbtrail-ismbbtrail-l.md) to test whether the multibyte character is defined.
The [`setlocale`](./reference/setlocale-wsetlocale.md) and [`_create_locale`](./reference/create-locale-wcreate-locale.md) functions can use the Windows NLS API supported languages on operating systems that don't use the Unicode code page. For a list of supported languages by operating system version, see [Appendix A: Product Behavior](/openspecs/windows_protocols/ms-lcid/a9eac961-e77d-41a6-90a5-ce1a8b0cdb9c) in \[MS-LCID]: Windows Language Code Identifier (LCID) Reference. The language string can be any of the values in the **Language** and **Language tag** columns of the list of supported languages. For example code that enumerates available locale names and related values, see [NLS: Name-based APIs Sample](/windows/win32/intl/nls--name-based-apis-sample).
9
+
The [`setlocale`](reference/setlocale-wsetlocale.md) and [`_create_locale`](reference/create-locale-wcreate-locale.md) functions can use the Windows NLS API supported languages on operating systems that don't use the Unicode code page. For a list of supported languages by operating system version, see [Appendix A: Product Behavior](/openspecs/windows_protocols/ms-lcid/a9eac961-e77d-41a6-90a5-ce1a8b0cdb9c) in \[MS-LCID]: Windows Language Code Identifier (LCID) Reference. The language string can be any of the values in the **Language** and **Language tag** columns of the list of supported languages. For example code that enumerates available locale names and related values, see [NLS: Name-based APIs Sample](/windows/win32/intl/nls--name-based-apis-sample).
10
10
11
11
## Supported language strings
12
12
@@ -82,7 +82,7 @@ The Microsoft C run-time library implementation also supports these language str
82
82
83
83
## See also
84
84
85
-
-[Locale names, Languages, and Country/Region strings](./locale-names-languages-and-country-region-strings.md)
Copy file name to clipboardExpand all lines: docs/cpp/casting.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,21 +9,21 @@ ai-usage: ai-assisted
9
9
10
10
In C++, if a class is derived from a base class containing one or more virtual functions, a pointer to that base class type can be used to call virtual functions in the derived class object. A class containing virtual functions is sometimes called a "polymorphic class."
11
11
12
-
<br/>
12
+
<br/>
13
13
Class hierarchy
14
14
15
15
An object of type `C` can be visualized as follows:
16
16
17
-
 <br/>
17
+
 <br/>
18
18
Class C with subobjects B and A
19
19
20
20
Given an instance of class `C`, there's a `B` subobject and an `A` subobject. The instance of `C`, including the `A` and `B` subobjects, is the "complete object."
21
21
22
22
Because a derived class completely contains the definitions of all the base classes from which it's derived, it's safe to cast a pointer to any of its base classes (also called an upcast). Given a pointer to a base class, it may be safe to cast the pointer to an instance of a derived class (also called a downcast).
23
23
24
-
Using run-time type information, it's possible to check whether a pointer actually points to a complete object and can be safely cast to point to another object in its hierarchy. The [dynamic_cast](../cpp/dynamic-cast-operator.md) operator performs a run-time check to ensure that the operation is safe. It's better to design your class hierarchy so that you can use virtual functions to avoid the need for downcasting. However, if you must downcast, use `dynamic_cast` to ensure that the operation is safe.
24
+
Using run-time type information, it's possible to check whether a pointer actually points to a complete object and can be safely cast to point to another object in its hierarchy. The [dynamic_cast](dynamic-cast-operator.md) operator performs a run-time check to ensure that the operation is safe. It's better to design your class hierarchy so that you can use virtual functions to avoid the need for downcasting. However, if you must downcast, use `dynamic_cast` to ensure that the operation is safe.
25
25
26
-
For conversion of nonpolymorphic types, you can use the [static_cast](../cpp/static-cast-operator.md) operator (this topic explains the difference between static and dynamic casting conversions, and when it's appropriate to use each).
26
+
For conversion of nonpolymorphic types, you can use the [static_cast](static-cast-operator.md) operator (this topic explains the difference between static and dynamic casting conversions, and when it's appropriate to use each).
27
27
28
28
The following example demonstrates the use of `dynamic_cast` and `static_cast`:
0 commit comments