Skip to content

Commit 3517d0f

Browse files
authored
Merge pull request #5752 from MicrosoftDocs/FromPublicMasterBranch
Confirm merge from FromPublicMasterBranch to main to sync with https://github.com/MicrosoftDocs/cpp-docs (branch main)
2 parents f1fc8e7 + 8058b38 commit 3517d0f

17 files changed

+62
-80
lines changed

docs/build/creating-precompiled-header-files.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
description: "Learn more about: Precompiled header files"
32
title: "Precompiled Header Files"
3+
description: "Learn more about: Precompiled header files"
44
ms.date: 06/29/2022
55
helpviewer_keywords: ["precompiled header files, creating", "PCH files, creating", "cl.exe compiler, precompiling code", ".pch files, creating"]
66
---
@@ -259,7 +259,7 @@ Source file `ANOTHER.H`:
259259
//
260260
#ifndef __ANOTHER_H
261261
#define __ANOTHER_H
262-
#include<iostream>
262+
#include <iostream>
263263
void savemoretime( void );
264264
#endif // __ANOTHER_H
265265
```
@@ -273,7 +273,7 @@ Source file `STABLE.H`:
273273
//
274274
#ifndef __STABLE_H
275275
#define __STABLE_H
276-
#include<iostream>
276+
#include <iostream>
277277
void savetime( void );
278278
#endif // __STABLE_H
279279
```
@@ -289,7 +289,7 @@ Source file `UNSTABLE.H`:
289289
//
290290
#ifndef __UNSTABLE_H
291291
#define __UNSTABLE_H
292-
#include<iostream>
292+
#include <iostream>
293293
void notstable( void );
294294
#endif // __UNSTABLE_H
295295
```
@@ -301,9 +301,9 @@ Source file `APPLIB.CPP`:
301301
// the interface code declared in the header
302302
// files STABLE.H, ANOTHER.H, and UNSTABLE.H.
303303
//
304-
#include"another.h"
305-
#include"stable.h"
306-
#include"unstable.h"
304+
#include "another.h"
305+
#include "stable.h"
306+
#include "unstable.h"
307307
using namespace std;
308308
// The following code represents code that is deemed stable and
309309
// not likely to change. The associated interface code is
@@ -331,9 +331,9 @@ Source file `MYAPP.CPP`:
331331
// listed in the BOUNDRY macro. Unstable code must
332332
// be included after the precompiled code.
333333
//
334-
#include"another.h"
335-
#include"stable.h"
336-
#include"unstable.h"
334+
#include "another.h"
335+
#include "stable.h"
336+
#include "unstable.h"
337337
int main( void )
338338
{
339339
savetime();

docs/c-runtime-library/reference/abort.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
description: "Learn more about: abort"
32
title: "abort"
3+
description: "Learn more about: abort"
44
ms.date: 07/07/2022
55
api_name: ["abort", "_o_abort"]
66
api_location: ["msvcrt.dll", "msvcr80.dll", "msvcr90.dll", "msvcr100.dll", "msvcr100_clr0400.dll", "msvcr110.dll", "msvcr110_clr0400.dll", "msvcr120.dll", "msvcr120_clr0400.dll", "ucrtbase.dll", "api-ms-win-crt-runtime-l1-1-0.dll"]
@@ -71,8 +71,8 @@ The following program tries to open a file and aborts if the attempt fails.
7171
// the abort function by attempting to open a file
7272
// and aborts if the attempt fails.
7373
74-
#include <stdio.h>
75-
#include <stdlib.h>
74+
#include <stdio.h>
75+
#include <stdlib.h>
7676
7777
int main( void )
7878
{

docs/c-runtime-library/reference/access-waccess.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
description: "Learn more about: _access, _waccess"
32
title: "_access, _waccess"
3+
description: "Learn more about: _access, _waccess"
44
ms.date: "4/2/2020"
55
api_name: ["_access", "_waccess", "t_access", "_o__access", "_o__waccess"]
66
api_location: ["msvcrt.dll", "msvcr80.dll", "msvcr90.dll", "msvcr100.dll", "msvcr100_clr0400.dll", "msvcr110.dll", "msvcr110_clr0400.dll", "msvcr120.dll", "msvcr120_clr0400.dll", "ucrtbase.dll", "api-ms-win-crt-filesystem-l1-1-0.dll"]
@@ -90,9 +90,9 @@ The following example uses **`_access`** to check the file named *`crt_ACCESS.C`
9090
// This example uses _access to check the file named
9191
// crt_ACCESS.C to see if it exists and if writing is allowed.
9292

93-
#include <io.h>
94-
#include <stdio.h>
95-
#include <stdlib.h>
93+
#include <io.h>
94+
#include <stdio.h>
95+
#include <stdlib.h>
9696

9797
int main( void )
9898
{

docs/c-runtime-library/reference/dupenv-s-dbg-wdupenv-s-dbg.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
---
2-
description: "Learn more about: _dupenv_s_dbg, _wdupenv_s_dbg"
32
title: "_dupenv_s_dbg, _wdupenv_s_dbg"
3+
description: "Learn more about: _dupenv_s_dbg, _wdupenv_s_dbg"
44
ms.date: "11/04/2016"
55
api_name: ["_dupenv_s_dbg", "_wdupenv_s_dbg"]
66
api_location: ["msvcrt.dll", "msvcr80.dll", "msvcr90.dll", "msvcr100.dll", "msvcr100_clr0400.dll", "msvcr110.dll", "msvcr110_clr0400.dll", "msvcr120.dll", "msvcr120_clr0400.dll", "ucrtbase.dll"]
77
api_type: ["DLLExport"]
88
topic_type: ["apiref"]
99
f1_keywords: ["_tdupenv_s_dbg", "_dupenv_s_dbg", "_wdupenv_s_dbg"]
1010
helpviewer_keywords: ["_tdupenv_s_dbg function", "dupenv_s_dbg function", "_wdupenv_s_dbg function", "environment variables", "tdupenv_s_dbg function", "wdupenv_s_dbg function", "_dupenv_s_dbg function"]
11-
ms.assetid: e3d81148-e24e-46d0-a21d-fd87b5e6256c
1211
---
1312
# `_dupenv_s_dbg`, `_wdupenv_s_dbg`
1413

@@ -88,7 +87,7 @@ For more compatibility information, see [Compatibility](../compatibility.md).
8887

8988
```C
9089
// crt_dupenv_s_dbg.c
91-
#include <stdlib.h>
90+
#include <stdlib.h>
9291
#include <crtdbg.h>
9392

9493
int main( void )

docs/c-runtime-library/reference/dupenv-s-wdupenv-s.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
---
2-
description: "Learn more about: _dupenv_s, _wdupenv_s"
32
title: "_dupenv_s, _wdupenv_s"
3+
description: "Learn more about: _dupenv_s, _wdupenv_s"
44
ms.date: "4/2/2020"
55
api_name: ["_dupenv_s", "_wdupenv_s", "_o__dupenv_s", "_o__wdupenv_s"]
66
api_location: ["msvcrt.dll", "msvcr80.dll", "msvcr90.dll", "msvcr100.dll", "msvcr100_clr0400.dll", "msvcr110.dll", "msvcr110_clr0400.dll", "msvcr120.dll", "msvcr120_clr0400.dll", "ucrtbase.dll", "api-ms-win-crt-environment-l1-1-0.dll"]
77
api_type: ["DLLExport"]
88
topic_type: ["apiref"]
99
f1_keywords: ["tdupenv_s", "_dupenv_s", "wdupenv_s", "dupenv_s", "_tdupenv_s", "_wdupenv_s"]
1010
helpviewer_keywords: ["_dupenv_s function", "_tdupenv_s function", "_wdupenv_s function", "environment variables", "wdupenv_s function", "dupenv_s function", "tdupenv_s function"]
11-
ms.assetid: b729ecc2-a31d-4ccf-92a7-5accedb8f8c8
1211
---
1312
# `_dupenv_s`, `_wdupenv_s`
1413

@@ -89,7 +88,7 @@ For more compatibility information, see [Compatibility](../compatibility.md).
8988

9089
```C
9190
// crt_dupenv_s.c
92-
#include <stdlib.h>
91+
#include <stdlib.h>
9392

9493
int main( void )
9594
{

docs/c-runtime-library/reference/strncnt-wcsncnt-mbsnbcnt-mbsnbcnt-l-mbsnccnt-mbsnccnt-l.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
---
2-
description: "Learn more about: _strncnt, _wcsncnt, _mbsnbcnt, _mbsnbcnt_l, _mbsnccnt, _mbsnccnt_l"
32
title: "_strncnt, _wcsncnt, _mbsnbcnt, _mbsnbcnt_l, _mbsnccnt, _mbsnccnt_l"
3+
description: "Learn more about: _strncnt, _wcsncnt, _mbsnbcnt, _mbsnbcnt_l, _mbsnccnt, _mbsnccnt_l"
44
ms.date: "4/2/2020"
55
api_name: ["_mbsnbcnt_l", "_mbsnccnt", "_wcsncnt", "_strncnt", "_mbsnccnt_l", "_mbsnbcnt", "_o__mbsnbcnt", "_o__mbsnbcnt_l", "_o__mbsnccnt", "_o__mbsnccnt_l"]
66
api_location: ["msvcrt.dll", "msvcr80.dll", "msvcr90.dll", "msvcr100.dll", "msvcr100_clr0400.dll", "msvcr110.dll", "msvcr110_clr0400.dll", "msvcr120.dll", "msvcr120_clr0400.dll", "ucrtbase.dll", "api-ms-win-crt-multibyte-l1-1-0.dll"]
77
api_type: ["DLLExport"]
88
topic_type: ["apiref"]
99
f1_keywords: ["_mbsnbcnt", "wcsncnt", "_tcsnbcnt", "_mbsnccnt", "_ftcsnbcnt", "mbsnbcnt", "strncnt", "mbsnbcnt_l", "mbsnccnt_l", "mbsnccnt", "_strncnt", "_wcsncnt"]
1010
helpviewer_keywords: ["_strncnt function", "_mbsnbcnt function", "_mbsnbcnt_l function", "_mbsnccnt_l function", "mbsnbcnt_l function", "mbsnbcnt function", "tcsnbcnt function", "mbsnccnt_l function", "strncnt function", "_tcsnbcnt function", "mbsnccnt function", "wcsncnt function", "_mbsnccnt function", "_wcsncnt function"]
11-
ms.assetid: 2a022e9e-a307-4acb-a66b-e56e5357f848
1211
---
1312
# `_strncnt`, `_wcsncnt`, `_mbsnbcnt`, `_mbsnbcnt_l`, `_mbsnccnt`, `_mbsnccnt_l`
1413

@@ -105,8 +104,8 @@ For more compatibility information, see [Compatibility](../compatibility.md).
105104
```C
106105
// crt_mbsnbcnt.c
107106

108-
#include <mbstring.h>
109-
#include <stdio.h>
107+
#include <mbstring.h>
108+
#include <stdio.h>
110109

111110
int main( void )
112111
{

docs/code-quality/c6506.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
---
2-
description: "Learn more about: Warning C6506"
32
title: Warning C6506
3+
description: "Learn more about: Warning C6506"
44
ms.date: 11/04/2016
55
f1_keywords: ["C6506", "BUFFER_SIZE_ON_NON_POINTER_OR_ARRAY", "__WARNING_BUFFER_SIZE_ON_NON_POINTER_OR_ARRAY"]
66
helpviewer_keywords: ["C6506"]
7-
ms.assetid: 20b87ee8-13ea-4d71-95a1-2b2d144d196a
87
---
98
# Warning C6506
109

@@ -21,7 +20,7 @@ Code analysis name: `BUFFER_SIZE_ON_NON_POINTER_OR_ARRAY`
2120
The following code generates this warning:
2221

2322
```cpp
24-
#include<sal.h>
23+
#include <sal.h>
2524
void f(_Out_ char c)
2625
{
2726
c = 'd';
@@ -31,7 +30,7 @@ void f(_Out_ char c)
3130
To correct this warning, use a pointer or an array type, as shown in the following sample code:
3231
3332
```cpp
34-
#include<sal.h>
33+
#include <sal.h>
3534
void f(_Out_ char *c)
3635
{
3736
*c = 'd';

docs/dotnet/how-to-access-characters-in-a-system-string.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
---
2-
description: "Learn more about: How to: Access Characters in a System::String"
32
title: "How to: Access Characters in a System::String"
3+
description: "Learn more about: How to: Access Characters in a System::String"
44
ms.custom: "get-started-article"
55
ms.date: "11/04/2016"
66
helpviewer_keywords: ["characters [C++], accessing in System::String", "examples [C++], strings", "strings [C++], accessing characters"]
7-
ms.assetid: cfc89756-aef3-4988-907e-fb236dcb7087
87
---
98
# How to: Access Characters in a System::String
109

@@ -21,7 +20,7 @@ If you pass `ppchar` to a native function, then it must be a pinning pointer; th
2120
```cpp
2221
// PtrToStringChars.cpp
2322
// compile with: /clr
24-
#include<vcclr.h>
23+
#include <vcclr.h>
2524
using namespace System;
2625

2726
int main() {

docs/dotnet/how-to-define-and-consume-classes-and-structs-cpp-cli.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ title: "How to: Define and consume classes and structs (C++/CLI)"
33
description: "How to create and use user-defined class and struct types in C++/CLI code."
44
ms.date: 09/25/2020
55
helpviewer_keywords: ["structs [C++]", "classes [C++], instantiating"]
6-
ms.assetid: 1c03cb0d-1459-4b5e-af65-97d6b3094fd7
76
---
87
# How to: Define and consume classes and structs (C++/CLI)
98

@@ -636,7 +635,7 @@ The following sample demonstrates when a copy constructor isn't generated.
636635

637636
```cpp
638637
// compile with: /clr
639-
#include<stdio.h>
638+
#include <stdio.h>
640639

641640
struct S {
642641
int i;
Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,22 @@
11
---
2-
description: "Learn more about: Compiler Error C2006"
32
title: "Compiler Error C2006"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2006"
4+
ms.date: "01/28/2025"
55
f1_keywords: ["C2006"]
66
helpviewer_keywords: ["C2006"]
7-
ms.assetid: caaed6f7-ceb9-4742-8820-d66657c0b04d
87
---
98
# Compiler Error C2006
109

11-
'directive' expected a filename, found 'token'
10+
'directive': expected "FILENAME" or \<FILENAME>
1211

13-
Directives such as [#include](../../preprocessor/hash-include-directive-c-cpp.md) or [#import](../../preprocessor/hash-import-directive-cpp.md) require a filename. To resolve the error, make sure *token* is a valid filename. Also, put the filename in double quotes or angle brackets.
12+
Directives such as [#include](../../preprocessor/hash-include-directive-c-cpp.md) or [#import](../../preprocessor/hash-import-directive-cpp.md) require a filename. To resolve the error, ensure the filename is valid and enclosed in either double quotes or angle brackets.
1413

1514
The following sample generates C2006:
1615

1716
```cpp
1817
// C2006.cpp
19-
#include stdio.h // C2006
20-
```
21-
22-
Possible resolution:
23-
24-
```cpp
25-
// C2006b.cpp
2618
// compile with: /c
27-
#include <stdio.h>
19+
#include iostream // C2006
20+
#include 'iostream' // C2006
21+
#include <iostream> // OK
2822
```

docs/error-messages/compiler-errors-2/compiler-error-c2893.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
---
2-
description: "Learn more about: Compiler Error C2893"
32
title: "Compiler Error C2893"
3+
description: "Learn more about: Compiler Error C2893"
44
ms.date: "11/04/2016"
55
f1_keywords: ["C2893"]
66
helpviewer_keywords: ["C2893"]
7-
ms.assetid: ec0cbe43-005d-45da-8742-aaeb9b81d28e
87
---
98
# Compiler Error C2893
109

@@ -21,7 +20,7 @@ C2893 occurs because `f`'s template parameter `T` is deduced to be `std::map<int
2120
```cpp
2221
// C2893.cpp
2322
// compile with: /c /EHsc
24-
#include<map>
23+
#include <map>
2524
using namespace std;
2625
class MyClass {};
2726

docs/error-messages/compiler-errors-2/compiler-error-c3867.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
---
2-
description: "Learn more about: Compiler Error C3867"
32
title: "Compiler Error C3867"
3+
description: "Learn more about: Compiler Error C3867"
44
ms.date: "11/04/2016"
55
f1_keywords: ["C3867"]
66
helpviewer_keywords: ["C3867"]
7-
ms.assetid: bc5de03f-e01a-4407-88c3-2c63f0016a1e
87
---
98
# Compiler Error C3867
109

@@ -42,7 +41,7 @@ The following sample generates C3867 and shows how to fix it.
4241
4342
```cpp
4443
// C3867_2.cpp
45-
#include<stdio.h>
44+
#include <stdio.h>
4645
4746
struct S {
4847
char *func() {

docs/standard-library/bad-alloc-class.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
---
2-
description: "Learn more about: bad_alloc Class"
32
title: "bad_alloc Class"
3+
description: "Learn more about: bad_alloc Class"
44
ms.date: "11/04/2016"
55
f1_keywords: ["new/std::bad_alloc"]
66
helpviewer_keywords: ["bad_alloc class"]
7-
ms.assetid: 6429a8e6-5a49-4907-8d56-f4a4ec8131d0
87
---
98
# bad_alloc Class
109

@@ -31,8 +30,8 @@ The value returned by `what` is an implementation-defined C string. None of the
3130
```cpp
3231
// bad_alloc.cpp
3332
// compile with: /EHsc
34-
#include<new>
35-
#include<iostream>
33+
#include <new>
34+
#include <iostream>
3635
using namespace std;
3736
3837
int main() {

docs/standard-library/hash-map-class.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
description: "Learn more about: hash_map Class"
32
title: "hash_map Class"
3+
description: "Learn more about: hash_map Class"
44
ms.date: "11/04/2016"
55
f1_keywords: ["hash_map/stdext::hash_map", "hash_map/stdext::hash_map::allocator_type", "hash_map/stdext::hash_map::const_iterator", "hash_map/stdext::hash_map::const_pointer", "hash_map/stdext::hash_map::const_reference", "hash_map/stdext::hash_map::const_reverse_iterator", "hash_map/stdext::hash_map::difference_type", "hash_map/stdext::hash_map::iterator", "hash_map/stdext::hash_map::key_compare", "hash_map/stdext::hash_map::key_type", "hash_map/stdext::hash_map::mapped_type", "hash_map/stdext::hash_map::pointer", "hash_map/stdext::hash_map::reference", "hash_map/stdext::hash_map::reverse_iterator", "hash_map/stdext::hash_map::size_type", "hash_map/stdext::hash_map::value_type", "hash_map/stdext::hash_map::at", "hash_map/stdext::hash_map::begin", "hash_map/stdext::hash_map::cbegin", "hash_map/stdext::hash_map::cend", "hash_map/stdext::hash_map::clear", "hash_map/stdext::hash_map::count", "hash_map/stdext::hash_map::crbegin", "hash_map/stdext::hash_map::crend", "hash_map/stdext::hash_map::emplace", "hash_map/stdext::hash_map::emplace_hint", "hash_map/stdext::hash_map::empty", "hash_map/stdext::hash_map::end", "hash_map/stdext::hash_map::equal_range", "hash_map/stdext::hash_map::erase", "hash_map/stdext::hash_map::find", "hash_map/stdext::hash_map::get_allocator", "hash_map/stdext::hash_map::insert", "hash_map/stdext::hash_map::key_comp", "hash_map/stdext::hash_map::lower_bound", "hash_map/stdext::hash_map::max_size", "hash_map/stdext::hash_map::rbegin", "hash_map/stdext::hash_map::rend", "hash_map/stdext::hash_map::size", "hash_map/stdext::hash_map::swap", "hash_map/stdext::hash_map::upper_bound", "hash_map/stdext::hash_map::value_comp"]
66
helpviewer_keywords: ["stdext::hash_map", "stdext::hash_map::allocator_type", "stdext::hash_map::const_iterator", "stdext::hash_map::const_pointer", "stdext::hash_map::const_reference", "stdext::hash_map::const_reverse_iterator", "stdext::hash_map::difference_type", "stdext::hash_map::iterator", "stdext::hash_map::key_compare", "stdext::hash_map::key_type", "stdext::hash_map::mapped_type", "stdext::hash_map::pointer", "stdext::hash_map::reference", "stdext::hash_map::reverse_iterator", "stdext::hash_map::size_type", "stdext::hash_map::value_type", "stdext::hash_map::at", "stdext::hash_map::begin", "stdext::hash_map::cbegin", "stdext::hash_map::cend", "stdext::hash_map::clear", "stdext::hash_map::count", "stdext::hash_map::crbegin", "stdext::hash_map::crend", "stdext::hash_map::emplace", "stdext::hash_map::emplace_hint", "stdext::hash_map::empty", "stdext::hash_map::end", "stdext::hash_map::equal_range", "stdext::hash_map::erase", "stdext::hash_map::find", "stdext::hash_map::get_allocator", "stdext::hash_map::insert", "stdext::hash_map::key_comp", "stdext::hash_map::lower_bound", "stdext::hash_map::max_size", "stdext::hash_map::rbegin", "stdext::hash_map::rend", "stdext::hash_map::size", "stdext::hash_map::swap", "stdext::hash_map::upper_bound", "stdext::hash_map::value_comp"]
@@ -817,8 +817,8 @@ The [`hash_map::value_type`](#value_type) of an element is a pair, so that the v
817817
```cpp
818818
// hash_map_emplace.cpp
819819
// compile with: /EHsc
820-
#include<hash_map>
821-
#include<iostream>
820+
#include <hash_map>
821+
#include <iostream>
822822
#include <string>
823823
824824
int main()
@@ -878,8 +878,8 @@ Insertion can occur in amortized constant time, instead of logarithmic time, if
878878
```cpp
879879
// hash_map_emplace_hint.cpp
880880
// compile with: /EHsc
881-
#include<hash_map>
882-
#include<iostream>
881+
#include <hash_map>
882+
#include <iostream>
883883
#include <string>
884884
885885
int main()
@@ -1545,8 +1545,8 @@ The third member function inserts the sequence of element values into a `hash_ma
15451545
```cpp
15461546
// hash_map_insert.cpp
15471547
// compile with: /EHsc
1548-
#include<hash_map>
1549-
#include<iostream>
1548+
#include <hash_map>
1549+
#include <iostream>
15501550
#include <string>
15511551
15521552
int main()

0 commit comments

Comments
 (0)