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
Returns a pointer to the last occurrence of *c* in *str*, or NULL if *c* is not found.
88
+
Returns a pointer to the last occurrence of *`c`* in *`str`*, or `NULL` if *`c`* is not found.
90
89
91
90
## Remarks
92
91
93
-
The `strrchr` function finds the last occurrence of *c* (converted to **`char`**) in *str*. The search includes the terminating null character.
92
+
The `strrchr` function finds the last occurrence of *`c`* (converted to **`char`**) in *`str`*. The search includes the terminating `NULL` character.
94
93
95
94
`wcsrchr` and `_mbsrchr` are wide-character and multibyte-character versions of `strrchr`. The arguments and return value of `wcsrchr` are wide-character strings; those of `_mbsrchr` are multibyte-character strings.
96
95
97
-
In C, these functions take a **`const`** pointer for the first argument. In C++, two overloads are available. The overload taking a pointer to **`const`** returns a pointer to **`const`**; the version that takes a pointer to non-**`const`** returns a pointer to non-**`const`**. The macro _CRT_CONST_CORRECT_OVERLOADS is defined if both the **`const`** and non-**`const`** versions of these functions are available. If you require the non-**`const`** behavior for both C++ overloads, define the symbol _CONST_RETURN.
96
+
In C, these functions take a **`const`** pointer for the first argument. In C++, two overloads are available. The overload taking a pointer to **`const`** returns a pointer to **`const`**; the version that takes a pointer to non-**`const`** returns a pointer to non-**`const`**. The macro `_CRT_CONST_CORRECT_OVERLOADS` is defined if both the **`const`** and non-**`const`** versions of these functions are available. If you require the non-**`const`** behavior for both C++ overloads, define the symbol `_CONST_RETURN`.
98
97
99
-
`_mbsrchr` validates its parameters. If *str* is NULL, the invalid parameter handler is invoked, as described in [Parameter Validation](../../c-runtime-library/parameter-validation.md). If execution is allowed to continue, `errno` is set to EINVAL and `_mbsrchr` returns 0. `strrchr` and `wcsrchr` do not validate their parameters. These three functions behave identically otherwise.
98
+
`_mbsrchr` validates its parameters. If *`str`* is `NULL`, the invalid parameter handler is invoked, as described in [Parameter Validation](../../c-runtime-library/parameter-validation.md). If execution is allowed to continue, `errno` is set to `EINVAL` and `_mbsrchr` returns 0. `strrchr` and `wcsrchr` do not validate their parameters. These three functions behave identically otherwise.
100
99
101
-
The output value is affected by the setting of the LC_CTYPE category setting of the locale; for more information, see [setlocale](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. For more information, see [Locale](../../c-runtime-library/locale.md).
100
+
The output value is affected by the setting of the `LC_CTYPE` category setting of the locale; for more information, see [`setlocale`](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. For more information, see [Locale](../../c-runtime-library/locale.md).
102
101
103
102
By default, this function's global state is scoped to the application. To change this, see [Global state in the CRT](../global-state.md).
104
103
@@ -113,23 +112,23 @@ By default, this function's global state is scoped to the application. To change
113
112
114
113
|Routine|Required header|
115
114
|-------------|---------------------|
116
-
|`strrchr`|\<string.h>|
117
-
|`wcsrchr`|\<string.h> or \<wchar.h>|
118
-
|`_mbsrchr`, `_mbsrchr_l`|\<mbstring.h>|
115
+
|`strrchr`|`<string.h>`|
116
+
|`wcsrchr`|`<string.h>` or `<wchar.h>`|
117
+
|`_mbsrchr`, `_mbsrchr_l`|`<mbstring.h>`|
119
118
120
119
For more information about compatibility, see [Compatibility](../../c-runtime-library/compatibility.md).
121
120
122
121
## Example
123
122
124
-
For an example of using `strrchr`, see [strchr](strchr-wcschr-mbschr-mbschr-l.md).
123
+
For an example of using `strrchr`, see [`strchr`](strchr-wcschr-mbschr-mbschr-l.md).
0 commit comments