Skip to content

Commit 3786bb7

Browse files
Taojunshen3836425+corob-msft@users.noreply.github.comv-ccolinPMEds28kylereedmsft
authored
1/28/2021 AM Publish (#4067)
* Add `/Zc:externC` compiler option doc, fix 1594 * Tweaks. * Fix links, header syntax issues * Fix issues in XML Docs reference * Make list match apparently intended style * Fix broken link. * Add docs for new check Signed-off-by: Kyle Reed <[email protected]> * fix toc * remove .md from toc title * Revert "Add docs for new linter check" * update runtime spelling * Bulk fix: remove HTML entities from yml headers (MicrosoftDocs#3962) * Style and content fixes in cpp language docs * Changing confusing wording about C++ exceptions * Bulk fix HTML entities in H1 (MicrosoftDocs#3966) * Fix lt-gt entity pairs * Bulk fix of `&lt;`-`&gt;` pairs in H1 headings * Oops, deleted initial `#` * Fix two more H1 issues * update with existing .openpublishing.publish.config.json * C++ tutorial landing page, attempt 2 * Revert redirection of get-started index.yml file * Fix typo * Bulk fix `&lt;`, `&gt;`, and `.period;` entities * operatoroperator * `/hotpatch`: No jump to the first instruction * Update Acrolinx for main branch * Change learn about item type * Add get started TOC * fix over machine translation problems (MicrosoftDocs#3977) * fix over machine translation problems * acrolinx and misses * markdown fixes Co-authored-by: TylerMSFT <[email protected]> * Make the grammar bot happy * Fix things that look like parameters. (#3978) * Fix things that look like parameters. * Acrolinxy * Misc fixes * Other fixes * Fix typos * Acrolinx some more * [17.0] Update links to download Visual Studio (MicrosoftDocs#3981) * Update links to download Visual Studio * Remove VS 2019 reference * Address cpp-docs 3565 * Also cpp-docs 439 * cpp-docs 947 * cpp-docs 1002 * accuratized * cpp-docs 1035 * Twhitney named modules (#3960) * draft * draft * draft * fix links * cleanup * added some more info * add some see also references * cleanup pass * remove text about overloads * tech review * little better wording * a little more word smithing * fix link * acrolinx * readthrough pass * Readthrough to test building the project * acrolinx * rename media file Co-authored-by: TylerMSFT <[email protected]> * cpp-docs 1305 * cpp-docs 1324 * address github issue #3524 and add code escape to prevent over machine translation * missed a couple escapes * couple more code escapes * one more escape * Address cpp-docs 3583: LNK1107 clarity * Tweaks * tweak formatting * Expand on fix for cpp-docs 1035 (#3986) * Expand of fix for cpp-docs 1035 * Mention overloads. * Grammar and formatting fixes * add summary of what will learn in module * [17.1p2] Add docs for comparison/bitwise c++ linter check. (MicrosoftDocs#3964) * Revert "Revert "Add docs for new linter check"" This reverts commit e56971f. * PR feedback Signed-off-by: Kyle Reed <[email protected]> * Update cmake-presets-vs.md * Update cmake-presets-vs.md * Switch http to https and fix broken links * Acrolinx * Style pass for the grammar checker bot * Fix two incorrect conditions in the ARM packed exception handling For the prologue, the distinction between `mov r11, sp` and `add r11, sp, #xx` lies only in whether other registers are pushed before R11 and LR in prologue instruction 2. (The condition `R`==1 and `PF`==0 corresponds to no other registers pushed before `r11`.) The `L` flag doesn't affect it (and the documentation explicit says that when `C` is set, then `L` also must be set, thus `C`==1 and `L`==0 is tautological too). This was correctly described in the textual form, but the conditions in the table included one erronous case. For the epilogue, when `Ret`!=0, the function doesn't return by popping LR directly into PC, but with an explicit branch instruction (10a or 10b). In this case, if `L`==1, the LR register is included in the list of registers popped in instruction 8. If register homing is used (`H`==1), then instruction 9a is used instead of 9b. This case seemed to have been overlooked both in the textual description and in the table. Also, when prologue instruction form 3a is used, clarify that it corresponds to the unwind code FB (narrow nop) only, that unwinding such a prologue doesn't restore `sp` from `r11`. Also fix a typo and clarify that encodings with C=1, L=0 are invalid. * Address cpp-docs 3588 error in link commands (#3996) * Address cpp-docs 3588 error in link commands * Update ms.date * Acrolinx fixes to frontrun cpp-docs 3541 * Post-3541 acrolinx pass * Update how-to-marshal-structures-using-cpp-interop.md Change "=" into "-" * Add _CountOneBits[64] to the ARM64 intrinsic doc * Update .acrolinx-config.edn update to reflect default branch name change * Mark first code block as C++ Syntax highlighting did not work for the `using identifier = type;` block due to missing language information. * Fixed grammatical error in allocator-class.md "Constructing a container with a custom allocator provide control over allocation and freeing of that container's elements." -> "Constructing a container with a custom allocator provides control over allocation and freeing of that container's elements." * Update d-using-the-schedule-clause.md * Correct a word in the remarks of /DIRECTIVES. The section is .drectve instead of .drective. * std::is_standard_layout<Derived> * Make meaning clearer This makes the meaning clearer to me. The ". Or," seems like to strong of a separator for closely related phrases. * Update value-types-modern-cpp.md Commas to make the meaning clearer * add missing usage of CopyChars * update json examples (#4017) * update json examples * acrolinx Co-authored-by: TylerMSFT <[email protected]> * fix github issue #3600 * formatting cleanup and acrolinx * Address cpp-docs issues 3601 3622 3626 * Update deprecating-types-and-members-c-cx.md * PR review edit / relative link syntax * add code escape to prevent overtranslation * fix missed code elements and acrolinx * more cleanup * github fixes for #3635 and #3636 (MicrosoftDocs#4026) * github fixes for #3635 and #3636 * acrolinx and cleanup * nit Co-authored-by: TylerMSFT <[email protected]> * Update windows-store-apps-the-windows-runtime-and-the-c-run-time.md * Broken link fixed (MicrosoftDocs#4025) * Implement intrinics broken link fixes (MicrosoftDocs#4028) * Update deprecating-types-and-members-c-cx.md Add code formatting to links to prevent overlocalization and markdown processing issues. * Update windows-store-apps-the-windows-runtime-and-the-c-run-time.md * Follow-up cpp-docs 3637 for style and Acrolinx * [17.0] Add compiler option `/option:strict` (MicrosoftDocs#4002) * edit pass (#4035) * edit pass * acrolinx * acrolinx * minor edits Co-authored-by: TylerMSFT <[email protected]> * Fix non-blocking issues identified in MicrosoftDocs#4032 * Correct & complete REP* keywords in Prefix table * US1907300 - add md code escapes to code elements * US1907300 - add md code escapes to code elements - PR2 * updates after review * US1907300 - add md code escapes to code elements - PR2 * US1907300 - add md code escapes to code elements - PR3 * update after review * Add note about `_CRT_DECLARE_NONSTDC_NAMES` With `/c11` and `/c17` properly defining `__STDC__`, users may encounter that the POSIX functions they are relying on are no longer exposed. This was always the case with `/Za` but is now also visible with the standard C versions. * Update CComHeap for style, Acrolinx issue (MicrosoftDocs#3963) * Add links and make grammar checker happy * US1907300 - add md code escapes to code elements - PR3 * update after review * [17.1p3] /Zc:static_assert compiler option (#4001) * US1907300 - add md code escapes to code elements - PR3 * fix blocking issues * fix acrolinx issue * US1907300 - add md code escapes to code elements - PR4 (MicrosoftDocs#4061) * US1907300 - add md code escapes to code elements - PR4 * updates after review Co-authored-by: [email protected] <[email protected]> Co-authored-by: Colin Cooper <[email protected]> Co-authored-by: Paula Miller <[email protected]> Co-authored-by: Kyle Reed <[email protected]> Co-authored-by: opbld15 <[email protected]> Co-authored-by: John Ellison <[email protected]> Co-authored-by: TylerMSFT <[email protected]> Co-authored-by: Hannes Harnisch <[email protected]> Co-authored-by: opbld16 <[email protected]> Co-authored-by: Anna Huff <[email protected]> Co-authored-by: Ying Hua <[email protected]> Co-authored-by: Alex Guteniev <[email protected]> Co-authored-by: opbld17 <[email protected]> Co-authored-by: Dennis Rea <[email protected]> Co-authored-by: Tyler Whitney <[email protected]> Co-authored-by: Laura Brenner <[email protected]> Co-authored-by: PRMerger3 <[email protected]> Co-authored-by: PRMerger18 <[email protected]> Co-authored-by: PRMerger Service account 2 <[email protected]> Co-authored-by: Jonathan Sweemer <[email protected]> Co-authored-by: Martin Storsjö <[email protected]> Co-authored-by: Kristine Toliver <[email protected]> Co-authored-by: AndreaLu <[email protected]> Co-authored-by: Matt Gardner <[email protected]> Co-authored-by: Sarah Vilaysom <[email protected]> Co-authored-by: Matthias <[email protected]> Co-authored-by: James Oswald <[email protected]> Co-authored-by: Anton Curmanschii <[email protected]> Co-authored-by: ROOOO <[email protected]> Co-authored-by: luozhiya <[email protected]> Co-authored-by: Zane Hitchcox <[email protected]> Co-authored-by: Chris Ho <[email protected]> Co-authored-by: Haig MacGregor <[email protected]> Co-authored-by: PRMerger5 <[email protected]> Co-authored-by: Jaiganesh Kumaran <[email protected]> Co-authored-by: Jak Koke <[email protected]> Co-authored-by: atikmapari <[email protected]> Co-authored-by: Linda Spiller <[email protected]> Co-authored-by: tjs137 <[email protected]> Co-authored-by: Craig Casey <[email protected]> Co-authored-by: Elnar Dakeshov <[email protected]>
1 parent 8f3f872 commit 3786bb7

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)