Skip to content

Commit 5285d3d

Browse files
authored
Merge pull request MicrosoftDocs#1773 from NextTurn/cpp-4
Add language identifiers
2 parents 48b62e6 + 751e161 commit 5285d3d

File tree

67 files changed

+115
-115
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+115
-115
lines changed

docs/build/reference/c-preserve-comments-during-preprocessing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ This compiler option requires the **/E**, **/P**, or **/EP** option.
2121

2222
The following code sample will display the source code comment.
2323

24-
```
24+
```cpp
2525
// C_compiler_option.cpp
2626
// compile with: /E /C /c
2727
int i; // a variable

docs/build/reference/clrsupportlasterror-preserve-last-error-code-for-pinvoke-calls.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ You can minimize the performance impact by linking with **/CLRSUPPORTLASTERROR:S
7575

7676
The following sample defines a native DLL with one exported function that modifies last error.
7777

78-
```
78+
```cpp
7979
// CLRSUPPORTLASTERROR_dll.cpp
8080
// compile with: /LD
8181
#include <windows.h>
@@ -92,7 +92,7 @@ __declspec(dllexport) double MySqrt(__int64 n) {
9292
9393
The following sample consumes the DLL, demonstrating how to use **/CLRSUPPORTLASTERROR**.
9494
95-
```
95+
```cpp
9696
// CLRSUPPORTLASTERROR_client.cpp
9797
// compile with: /clr CLRSUPPORTLASTERROR_dll.lib /link /clrsupportlasterror:systemdll
9898
// processor: x86

docs/build/reference/example-visual-cpp.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Compile with [/doc](doc-process-documentation-comments-c-cpp.md) to process docu
2626

2727
## Example
2828

29-
```
29+
```cpp
3030
// xml_example_tag.cpp
3131
// compile with: /clr /doc /LD
3232
// post-build command: xdcmake xml_example_tag.dll

docs/build/reference/exception-visual-cpp.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ The MSVC compiler will attempt to resolve cref references in one pass through th
3535

3636
## Example
3737

38-
```
38+
```cpp
3939
// xml_exception_tag.cpp
4040
// compile with: /clr /doc /LD
4141
// post-build command: xdcmake xml_exception_tag.dll

docs/build/reference/paramref-visual-cpp.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Compile with [/doc](doc-process-documentation-comments-c-cpp.md) to process docu
2626

2727
## Example
2828

29-
```
29+
```cpp
3030
// xml_paramref_tag.cpp
3131
// compile with: /clr /doc /LD
3232
// post-build command: xdcmake xml_paramref_tag.dll

docs/build/reference/permission-visual-cpp.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ The MSVC compiler will attempt to resolve cref references in one pass through th
3535

3636
## Example
3737

38-
```
38+
```cpp
3939
// xml_permission_tag.cpp
4040
// compile with: /clr /doc /LD
4141
// post-build command: xdcmake xml_permission_tag.dll

docs/build/reference/remarks-visual-cpp.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Compile with [/doc](doc-process-documentation-comments-c-cpp.md) to process docu
2626

2727
## Example
2828

29-
```
29+
```cpp
3030
// xml_remarks_tag.cpp
3131
// compile with: /LD /clr /doc
3232
// post-build command: xdcmake xml_remarks_tag.dll

docs/build/reference/returns-visual-cpp.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Compile with [/doc](doc-process-documentation-comments-c-cpp.md) to process docu
2626

2727
## Example
2828

29-
```
29+
```cpp
3030
// xml_returns_tag.cpp
3131
// compile with: /LD /clr /doc
3232
// post-build command: xdcmake xml_returns_tag.dll

docs/build/reference/see-visual-cpp.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ The MSVC compiler will attempt to resolve cref references in one pass through th
3434

3535
The following sample shows how you can make cref reference to a generic type, such that, the compiler will resolve the reference.
3636

37-
```
37+
```cpp
3838
// xml_see_cref_example.cpp
3939
// compile with: /LD /clr /doc
4040
// the following cref shows how to specify the reference, such that,

docs/build/reference/seealso-visual-cpp.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ The MSVC compiler will attempt to resolve cref references in one pass through th
3636

3737
In the following sample, an unresolved symbol is referenced in a cref. The XML comment for the cref to B::Test will be `<seealso cref="!:B::Test" />`, whereas the reference to A::Test is well-formed `<seealso cref="M:A.Test" />`.
3838

39-
```
39+
```cpp
4040
// xml_seealso_tag.cpp
4141
// compile with: /LD /clr /doc
4242
// post-build command: xdcmake xml_seealso_tag.dll

docs/build/reference/summary-visual-cpp.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Compile with [/doc](doc-process-documentation-comments-c-cpp.md) to process docu
2828

2929
## Example
3030

31-
```
31+
```cpp
3232
// xml_summary_tag.cpp
3333
// compile with: /LD /clr /doc
3434
// post-build command: xdcmake xml_summary_tag.dll

docs/build/reference/value-visual-cpp.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Compile with [/doc](doc-process-documentation-comments-c-cpp.md) to process docu
2626

2727
## Example
2828

29-
```
29+
```cpp
3030
// xml_value_tag.cpp
3131
// compile with: /LD /clr /doc
3232
// post-build command: xdcmake xml_value_tag.dll

docs/build/reference/wl-enable-one-line-diagnostics.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Error and warning messages from the C++ compiler can be followed by additional i
2121

2222
Not all error and warning messages have an additional line of information. The following code will generate an error that has an additional line of information; it will let you test the effect when you use **/WL**.
2323

24-
```
24+
```cpp
2525
// compiler_option_WL.cpp
2626
// compile with: /WL
2727
#include <queue>

docs/build/reference/zl-omit-default-library-name.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ For more information, see [CRT Library Features](../../c-runtime-library/crt-lib
2929

3030
When compiling with **/Zl**, `_VC_NODEFAULTLIB` is defined. For example:
3131

32-
```
32+
```cpp
3333
// vc_nodefaultlib.cpp
3434
// compile with: /Zl
3535
void Test() {

docs/cpp/considerations-for-writing-prolog-epilog-code.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ mov eax, [ebp - __LOCAL_SIZE] ;Error
4545

4646
The following example of a naked function containing custom prolog and epilog sequences uses the `__LOCAL_SIZE` symbol in the prolog sequence:
4747

48-
```
48+
```cpp
4949
// the__local_size_symbol.cpp
5050
// processor: x86
5151
__declspec ( naked ) int main() {
@@ -71,4 +71,4 @@ __declspec ( naked ) int main() {
7171
7272
## See also
7373
74-
[Naked Function Calls](../cpp/naked-function-calls.md)
74+
[Naked Function Calls](../cpp/naked-function-calls.md)

docs/dotnet/basic-concepts-in-using-managed-exceptions.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ For more information about differences in exception handling in managed and unma
2626

2727
The C++ throw expression is extended to throw a handle to a CLR type. The following example creates a custom exception type and then throws an instance of that type:
2828

29-
```
29+
```cpp
3030
// clr_exception_handling.cpp
3131
// compile with: /clr /c
3232
ref struct MyStruct: public System::Exception {
@@ -42,7 +42,7 @@ void GlobalFunction() {
4242
4343
A value type must be boxed before being thrown:
4444
45-
```
45+
```cpp
4646
// clr_exception_handling_2.cpp
4747
// compile with: /clr /c
4848
value struct MyValueStruct {
@@ -59,7 +59,7 @@ void GlobalFunction() {
5959

6060
The same **try**/**catch** block structure can be used for catching both CLR and native exceptions:
6161

62-
```
62+
```cpp
6363
// clr_exception_handling_3.cpp
6464
// compile with: /clr
6565
using namespace System;

docs/dotnet/call-in-appdomain-function.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ The arguments of the function passed to `call_in_appdomain` must not be CLR type
5555

5656
## Example
5757

58-
```
58+
```cpp
5959
// msl_call_in_appdomain.cpp
6060
// compile with: /clr
6161

@@ -112,4 +112,4 @@ appDomain1 id = 2
112112
113113
**Header file** \<msclr\appdomain.h>
114114
115-
**Namespace** msclr
115+
**Namespace** msclr

docs/dotnet/calling-native-functions-from-managed-code.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ The samples in this section just illustrate how `PInvoke` can be used. `PInvoke`
2323

2424
The following example shows the use of `PInvoke` in a Visual C++ program. The native function puts is defined in msvcrt.dll. The DllImport attribute is used for the declaration of puts.
2525

26-
```
26+
```cpp
2727
// platform_invocation_services.cpp
2828
// compile with: /clr
2929
using namespace System;
@@ -40,7 +40,7 @@ int main() {
4040

4141
The following sample is equivalent to the previous sample, but uses IJW.
4242

43-
```
43+
```cpp
4444
// platform_invocation_services_2.cpp
4545
// compile with: /clr
4646
using namespace System;
@@ -133,7 +133,7 @@ char* fstringA(char* param) {
133133

134134
The following sample exhibits this problem, and even though the program may seem to give the correct output, the output is coming from memory that had been freed.
135135

136-
```
136+
```cpp
137137
// platform_invocation_services_5.cpp
138138
// compile with: /clr /c
139139
using namespace System;
@@ -188,7 +188,7 @@ You can specify marshaling information for individual arguments of a native func
188188
189189
In this example, the string is marshaled as a double-byte Unicode character string, LPWStr. The output is the first letter of Hello World! because the second byte of the marshaled string is null, and puts interprets this as the end-of-string marker.
190190
191-
```
191+
```cpp
192192
// platform_invocation_services_3.cpp
193193
// compile with: /clr
194194
using namespace System;

docs/dotnet/double-thunking-cpp.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ The following sample demonstrates double thunking. When compiled native (without
2626

2727
### Code
2828

29-
```
29+
```cpp
3030
// double_thunking.cpp
3131
// compile with: /clr
3232
#include <stdio.h>
@@ -84,7 +84,7 @@ The previous sample demonstrated the existence of double thunking. This sample s
8484
8585
### Code
8686
87-
```
87+
```cpp
8888
// double_thunking_2.cpp
8989
// compile with: /clr
9090
#include <time.h>

docs/dotnet/finally.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ The purpose of the `finally` block is to clean up any resources left after the e
1818

1919
The following example demonstrates a simple `finally` block:
2020

21-
```
21+
```cpp
2222
// keyword__finally.cpp
2323
// compile with: /clr
2424
using namespace System;

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Consider the following code. Pinning is not needed because `ppchar` is an inter
1717

1818
If you pass `ppchar` to a native function, then it must be a pinning pointer; the garbage collector will not be able to update any pointers on the unmanaged stack frame.
1919

20-
```
20+
```cpp
2121
// PtrToStringChars.cpp
2222
// compile with: /clr
2323
#include<vcclr.h>
@@ -41,7 +41,7 @@ abcdefg
4141

4242
This example shows where pinning is needed.
4343

44-
```
44+
```cpp
4545
// PtrToStringChars_2.cpp
4646
// compile with: /clr
4747
#include <string.h>
@@ -70,7 +70,7 @@ int main() {
7070

7171
An interior pointer has all the properties of a native C++ pointer. For example, you can use it to walk a linked data structure and do insertions and deletions using only one pointer:
7272

73-
```
73+
```cpp
7474
// PtrToStringChars_3.cpp
7575
// compile with: /clr /LD
7676
using namespace System;

docs/dotnet/how-to-call-native-dlls-from-managed-code-using-pinvoke.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ For functions that use only intrinsic types as arguments and return values, no e
1717

1818
Although it is not required, it is good practice to make P/Invoke declarations static members of a value class so that they do not exist in the global namespace, as demonstrated in this example.
1919

20-
```
20+
```cpp
2121
// pinvoke_basic.cpp
2222
// compile with: /clr
2323
using namespace System;

docs/dotnet/how-to-catch-exceptions-in-native-code-thrown-from-msil.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ For more information, see [Structured Exception Handling (C/C++)](../cpp/structu
1414

1515
The following sample defines a module with two functions, one that throws a native exception, and another that throws an MSIL exception.
1616

17-
```
17+
```cpp
1818
// catch_MSIL_in_native.cpp
1919
// compile with: /clr /c
2020
void Test() {
@@ -30,7 +30,7 @@ void Test2() {
3030

3131
The following sample defines a module that catches a native and MSIL exception.
3232

33-
```
33+
```cpp
3434
// catch_MSIL_in_native_2.cpp
3535
// compile with: /clr catch_MSIL_in_native.obj
3636
#include <iostream>

docs/dotnet/how-to-convert-between-system-guid-and-guid.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The following code sample shows how to convert between a <xref:System.Guid> and
1111

1212
## Example
1313

14-
```
14+
```cpp
1515
// convert_guids.cpp
1616
// compile with: /clr
1717
#include <windows.h>

docs/dotnet/how-to-convert-char-star-string-to-system-byte-array.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The most efficient way to convert a `char *` string to a <xref:System.Byte> arra
1111

1212
## Example
1313

14-
```
14+
```cpp
1515
// convert_native_string_to_Byte_array.cpp
1616
// compile with: /clr
1717
#include <string.h>

docs/dotnet/how-to-convert-from-a-dotnet-collection-to-a-stl-clr-container.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ This topic shows how to convert .NET collections to their equivalent STL/CLR con
2626

2727
In this example, we create a generic <xref:System.Collections.Generic.List%601> and add 5 elements to it. Then, we create a `vector` using the constructor that takes a <xref:System.Collections.Generic.IEnumerable%601> as an argument.
2828

29-
```
29+
```cpp
3030
// cliext_convert_list_to_vector.cpp
3131
// compile with: /clr
3232

@@ -72,7 +72,7 @@ The contents of the cliext::vector are:
7272

7373
In this example, we create a generic <xref:System.Collections.Generic.Dictionary%602> and add 5 elements to it. Then, we create a `collection_adapter` to wrap the <xref:System.Collections.Generic.Dictionary%602> as a simple STL/CLR container. Finally, we create a `map` and copy the contents of the <xref:System.Collections.Generic.Dictionary%602> to the `map` by iterating over the `collection_adapter`. During this process, we create a new pair by using the `make_pair` function, and insert the new pair directly into the `map`.
7474

75-
```
75+
```cpp
7676
// cliext_convert_dictionary_to_map.cpp
7777
// compile with: /clr
7878

docs/dotnet/how-to-convert-from-a-stl-clr-container-to-a-dotnet-collection.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ This topic shows how to convert STL/CLR containers to their equivalent .NET coll
2020

2121
In this example, we create a STL/CLR `vector` and add 5 elements to it. Then, we create a .NET collection by calling the `make_collection` function. Finally, we display the contents of the newly created collection.
2222

23-
```
23+
```cpp
2424
// cliext_convert_vector_to_icollection.cpp
2525
// compile with: /clr
2626

@@ -64,7 +64,7 @@ The contents of the System::Collections::Generic::ICollection are:
6464

6565
In this example, we create a STL/CLR `map` and add 5 elements to it. Then, we create a .NET <xref:System.Collections.Generic.IDictionary%602> and assign the `map` directly to it. Finally, we display the contents of the newly created collection.
6666

67-
```
67+
```cpp
6868
// cliext_convert_map_to_idictionary.cpp
6969
// compile with: /clr
7070

docs/dotnet/how-to-convert-standard-string-to-system-string.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ This topic shows how convert a C++ Standard Library string ([\<string>](../stand
1111

1212
## Example
1313

14-
```
14+
```cpp
1515
// convert_standard_string_to_system_string.cpp
1616
// compile with: /clr
1717
#include <string>

docs/dotnet/how-to-convert-system-string-to-standard-string.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ You can convert a <xref:System.String> to `std::string` or `std::wstring`, witho
1111

1212
## Example
1313

14-
```
14+
```cpp
1515
// convert_system_string.cpp
1616
// compile with: /clr
1717
#include <string>

docs/dotnet/how-to-convert-system-string-to-wchar-t-star-or-char-star.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ You can use `PtrToStringChars` in Vcclr.h to convert <xref:System.String> to nat
1111

1212
## Example
1313

14-
```
14+
```cpp
1515
// convert_string_to_wchar.cpp
1616
// compile with: /clr
1717
#include < stdio.h >

0 commit comments

Comments
 (0)