Skip to content

Commit 75a794a

Browse files
author
Colin Robertson
authored
Merge pull request MicrosoftDocs#3673 from MicrosoftDocs/main637789913376184433
Repo sync for protected CLA branch
2 parents 9256de2 + fcc64bb commit 75a794a

File tree

6 files changed

+325
-330
lines changed

6 files changed

+325
-330
lines changed

docs/c-runtime-library/reference/strrchr-wcsrchr-mbsrchr-mbsrchr-l.md

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@ api_type: ["DLLExport"]
88
topic_type: ["apiref"]
99
f1_keywords: ["_tcsrchr", "_ftcsrchr", "strrchr", "wcsrchr", "_mbsrchr"]
1010
helpviewer_keywords: ["_mbsrchr function", "tcsrchr function", "mbsrchr_l function", "characters [C++], scanning for", "ftcsrchr function", "_tcsrchr function", "strings [C++], scanning", "mbsrchr function", "strrchr function", "scanning strings", "wcsrchr function", "_ftcsrchr function", "_mbsrchr_l function"]
11-
ms.assetid: 75cf2664-758e-49bb-bf6b-8a139cd474d2
1211
---
13-
# strrchr, wcsrchr, _mbsrchr, _mbsrchr_l
12+
# `strrchr`, `wcsrchr`, `_mbsrchr`, `_mbsrchr_l`
1413

1514
Scans a string for the last occurrence of a character.
1615

@@ -75,30 +74,30 @@ const unsigned char *_mbsrchr_l(
7574

7675
### Parameters
7776

78-
*str*<br/>
77+
*`str`*\
7978
Null-terminated string to search.
8079

81-
*c*<br/>
80+
*`c`*\
8281
Character to be located.
8382

84-
*locale*<br/>
83+
*`locale`*\
8584
Locale to use.
8685

8786
## Return Value
8887

89-
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.
9089

9190
## Remarks
9291

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.
9493

9594
`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.
9695

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`.
9897

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.
10099

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).
102101

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

@@ -113,23 +112,23 @@ By default, this function's global state is scoped to the application. To change
113112

114113
|Routine|Required header|
115114
|-------------|---------------------|
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>`|
119118

120119
For more information about compatibility, see [Compatibility](../../c-runtime-library/compatibility.md).
121120

122121
## Example
123122

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).
125124

126125
## See also
127126

128-
[String Manipulation](../../c-runtime-library/string-manipulation-crt.md)<br/>
129-
[Locale](../../c-runtime-library/locale.md)<br/>
130-
[Interpretation of Multibyte-Character Sequences](../../c-runtime-library/interpretation-of-multibyte-character-sequences.md)<br/>
131-
[strchr, wcschr, _mbschr, _mbschr_l](strchr-wcschr-mbschr-mbschr-l.md)<br/>
132-
[strcspn, wcscspn, _mbscspn, _mbscspn_l](strcspn-wcscspn-mbscspn-mbscspn-l.md)<br/>
133-
[_strnicmp, _wcsnicmp, _mbsnicmp, _strnicmp_l, _wcsnicmp_l, _mbsnicmp_l](strnicmp-wcsnicmp-mbsnicmp-strnicmp-l-wcsnicmp-l-mbsnicmp-l.md)<br/>
134-
[strpbrk, wcspbrk, _mbspbrk, _mbspbrk_l](strpbrk-wcspbrk-mbspbrk-mbspbrk-l.md)<br/>
135-
[strspn, wcsspn, _mbsspn, _mbsspn_l](strspn-wcsspn-mbsspn-mbsspn-l.md)<br/>
127+
[String Manipulation](../../c-runtime-library/string-manipulation-crt.md)\
128+
[Locale](../../c-runtime-library/locale.md)\
129+
[Interpretation of Multibyte-Character Sequences](../../c-runtime-library/interpretation-of-multibyte-character-sequences.md)\
130+
[`strchr`, `wcschr`, `_mbschr`, `_mbschr_l`](strchr-wcschr-mbschr-mbschr-l.md)\
131+
[`strcspn`, `wcscspn`, `_mbscspn`, `_mbscspn_l`](strcspn-wcscspn-mbscspn-mbscspn-l.md)\
132+
[`_strnicmp`, `_wcsnicmp`, `_mbsnicmp`, `_strnicmp_l`, `_wcsnicmp_l`, `_mbsnicmp_l`](strnicmp-wcsnicmp-mbsnicmp-strnicmp-l-wcsnicmp-l-mbsnicmp-l.md)\
133+
[`strpbrk`, `wcspbrk`, `_mbspbrk`, `_mbspbrk_l`](strpbrk-wcspbrk-mbspbrk-mbspbrk-l.md)\
134+
[`strspn`, `wcsspn`, `_mbsspn`, `_mbsspn_l`](strspn-wcsspn-mbsspn-mbsspn-l.md)\

0 commit comments

Comments
 (0)