Skip to content

Commit a40afae

Browse files
author
3836425+corob-msft@users.noreply.github.com
committed
Markdown quality fixes 6 of N
1 parent 8c5e5b2 commit a40afae

File tree

9 files changed

+18
-36
lines changed

9 files changed

+18
-36
lines changed

docs/c-runtime-library/reference/vprintf-vprintf-l-vwprintf-vwprintf-l.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@ Each of these functions takes a pointer to an argument list, then formats and wr
6464
The versions of these functions with the **_l** suffix are identical except that they use the locale parameter passed in instead of the current thread locale.
6565

6666
> [!IMPORTANT]
67-
> Ensure that *format* is not a user-defined string. For more information, see [Avoiding Buffer Overruns](/windows/win32/SecBP/avoiding-buffer-overruns).
68-
Note that invalid format strings are detected and result in an error.
67+
> Ensure that *format* is not a user-defined string. For more information, see [Avoiding Buffer Overruns](/windows/win32/SecBP/avoiding-buffer-overruns). Invalid format strings are detected and result in an error.
6968
> Starting in Windows 10 version 2004 (build 19041), the `printf` family of functions prints exactly representable floating point numbers according to the IEEE 754 rules for rounding. In previous versions of Windows, exactly representable floating point numbers ending in '5' would always round up. IEEE 754 states that they must round to the closest even digit (also known as "Banker's Rounding"). For example, both `printf("%1.0f", 1.5)` and `printf("%1.0f", 2.5)` should round to 2. Previously, 1.5 would round to 2 and 2.5 would round to 3. This change only affects exactly representable numbers. For example, 2.35 (which, when represented in memory, is closer to 2.35000000000000008) continues to round up to 2.4. Rounding done by these functions now also respects the floating point rounding mode set by [`fesetround`](fegetround-fesetround2.md). Previously, rounding always chose `FE_TONEAREST` behavior. This change only affects programs built using Visual Studio 2019 version 16.2 and later. To use the legacy floating point rounding behavior, link with ['legacy_stdio_float_rounding.obj`](../link-options.md).
7069
7170
### Generic-Text Routine Mappings

docs/code-quality/c26401.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,3 @@ private:
6666
unsigned int ref_count_{1};
6767
};
6868
```
69-

docs/code-quality/c33011.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ void foo(Index idx, PFN(&functions)[5])
4848
```
4949
5050
These warnings are corrected by checking the index value for upper bound as well:
51+
5152
```cpp
5253
typedef void (*PFN)();
5354

docs/code-quality/c6031.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ void test_f()
8383
}
8484
```
8585

86-
In cases where it is necessary to ignore the return value of a function, assign the returned value to `std::ignore`. Assigning to `std::ignore` clearly indicates developer intent and helps in future code maintenance.
86+
In cases where it is necessary to ignore the return value of a function, assign the returned value to `std::ignore`. Assigning to `std::ignore` clearly indicates developer intent and helps in future code maintenance.
8787

8888
```cpp
8989
#include <tuple>
@@ -99,5 +99,5 @@ void f()
9999

100100
## See also
101101

102-
[fopen_s, _wfopen_s](../c-runtime-library/reference/fopen-s-wfopen-s.md)\
102+
[`fopen_s`, `_wfopen_s`](../c-runtime-library/reference/fopen-s-wfopen-s.md)\
103103
[Using SAL Annotations to reduce code defects](using-sal-annotations-to-reduce-c-cpp-code-defects.md)

docs/cpp/bstr-t-getaddress.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@ See [`_bstr_t::Assign`](../cpp/bstr-t-assign.md) for an example that uses **`Get
3333
3434
## See also
3535
36-
[`_bstr_t` class](../cpp/bstr-t-class.md)
36+
[`_bstr_t` class](../cpp/bstr-t-class.md)

docs/cpp/bstr-t-getbstr.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@ See [`_bstr_t::Assign`](../cpp/bstr-t-assign.md) for an example that uses **`Get
3333
3434
## See also
3535
36-
[`_bstr_t` class](../cpp/bstr-t-class.md)
36+
[`_bstr_t` class](../cpp/bstr-t-class.md)

docs/cpp/bstr-t-length.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ unsigned int length ( ) const throw( );
2323
2424
## See also
2525
26-
[`_bstr_t` class](../cpp/bstr-t-class.md)
26+
[`_bstr_t` class](../cpp/bstr-t-class.md)

docs/cpp/examples-of-lambda-expressions.md

Lines changed: 10 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ This article shows how to use lambda expressions in your programs. For an overvi
1515

1616
Because a lambda expression is typed, you can assign it to an **`auto`** variable or to a [`function`](../standard-library/function-class.md) object, as shown here:
1717

18-
### Code
19-
2018
```cpp
2119
// declaring_lambda_expressions1.cpp
2220
// compile with: /EHsc /W4
@@ -40,7 +38,7 @@ int main()
4038
}
4139
```
4240

43-
### Output
41+
The example produces this output:
4442

4543
```Output
4644
5
@@ -57,8 +55,6 @@ Although lambda expressions are most often declared in the body of a function, y
5755

5856
The Microsoft C++ compiler binds a lambda expression to its captured variables when the expression is declared instead of when the expression is called. The following example shows a lambda expression that captures the local variable `i` by value and the local variable `j` by reference. Because the lambda expression captures `i` by value, the reassignment of `i` later in the program does not affect the result of the expression. However, because the lambda expression captures `j` by reference, the reassignment of `j` does affect the result of the expression.
5957

60-
### Code
61-
6258
```cpp
6359
// declaring_lambda_expressions2.cpp
6460
// compile with: /EHsc /W4
@@ -85,7 +81,7 @@ int main()
8581
}
8682
```
8783

88-
### Output
84+
The example produces this output:
8985

9086
```Output
9187
47
@@ -101,8 +97,6 @@ You can call a lambda expression immediately, as shown in the next code snippet.
10197

10298
This example declares a lambda expression that returns the sum of two integers and calls the expression immediately with the arguments `5` and `4`:
10399

104-
### Code
105-
106100
```cpp
107101
// calling_lambda_expressions1.cpp
108102
// compile with: /EHsc
@@ -116,7 +110,7 @@ int main()
116110
}
117111
```
118112

119-
### Output
113+
The example produces this output:
120114

121115
```Output
122116
9
@@ -126,8 +120,6 @@ int main()
126120

127121
This example passes a lambda expression as an argument to the `find_if` function. The lambda expression returns **`true`** if its parameter is an even number.
128122

129-
### Code
130-
131123
```cpp
132124
// calling_lambda_expressions2.cpp
133125
// compile with: /EHsc /W4
@@ -161,7 +153,7 @@ int main()
161153
}
162154
```
163155

164-
### Output
156+
The example produces this output:
165157

166158
```Output
167159
The first even number in the list is 42.
@@ -179,8 +171,6 @@ For more information about the `find_if` function, see [`find_if`](../standard-l
179171

180172
You can nest a lambda expression inside another one, as shown in this example. The inner lambda expression multiplies its argument by 2 and returns the result. The outer lambda expression calls the inner lambda expression with its argument and adds 3 to the result.
181173

182-
### Code
183-
184174
```cpp
185175
// nesting_lambda_expressions.cpp
186176
// compile with: /EHsc /W4
@@ -199,7 +189,7 @@ int main()
199189
}
200190
```
201191

202-
### Output
192+
The example produces this output:
203193

204194
```Output
205195
13
@@ -217,8 +207,6 @@ In this example, `[](int y) { return y * 2; }` is the nested lambda expression.
217207

218208
Many programming languages support the concept of a *higher-order function.* A higher-order function is a lambda expression that takes another lambda expression as its argument or returns a lambda expression. You can use the [`function`](../standard-library/function-class.md) class to enable a C++ lambda expression to behave like a higher-order function. The following example shows a lambda expression that returns a `function` object and a lambda expression that takes a `function` object as its argument.
219209

220-
### Code
221-
222210
```cpp
223211
// higher_order_lambda_expression.cpp
224212
// compile with: /EHsc /W4
@@ -252,7 +240,7 @@ int main()
252240
}
253241
```
254242

255-
### Output
243+
The example produces this output:
256244

257245
```Output
258246
30
@@ -338,7 +326,7 @@ int main()
338326
}
339327
```
340328

341-
### Output
329+
The example produces this output:
342330

343331
```Output
344332
3
@@ -359,8 +347,6 @@ The `ApplyScale` function uses a lambda expression to print the product of the s
359347

360348
Because lambda expressions are typed, you can use them with C++ templates. The following example shows the `negate_all` and `print_all` functions. The `negate_all` function applies the unary **`operator-`** to each element in the `vector` object. The `print_all` function prints each element in the `vector` object to the console.
361349

362-
### Code
363-
364350
```cpp
365351
// template_lambda_expression.cpp
366352
// compile with: /EHsc
@@ -399,7 +385,7 @@ int main()
399385
}
400386
```
401387
402-
### Output
388+
The example produces this output:
403389
404390
```Output
405391
34
@@ -423,8 +409,6 @@ For more information about C++ templates, see [Templates](../cpp/templates-cpp.m
423409

424410
The body of a lambda expression follows the rules for both structured exception handling (SEH) and C++ exception handling. You can handle a raised exception in the body of a lambda expression or defer exception handling to the enclosing scope. The following example uses the **`for_each`** function and a lambda expression to fill a `vector` object with the values of another one. It uses a **`try`**/**`catch`** block to handle invalid access to the first vector.
425411

426-
### Code
427-
428412
```cpp
429413
// eh_lambda_expression.cpp
430414
// compile with: /EHsc /W4
@@ -461,7 +445,7 @@ int main()
461445
}
462446
```
463447

464-
### Output
448+
The example produces this output:
465449

466450
```Output
467451
Caught 'invalid vector<T> subscript'.
@@ -479,8 +463,6 @@ For more information about exception handling, see [Exception Handling](../cpp/e
479463

480464
The capture clause of a lambda expression cannot contain a variable that has a managed type. However, you can pass an argument that has a managed type to the parameter list of a lambda expression. The following example contains a lambda expression that captures the local unmanaged variable `ch` by value and takes a <xref:System.String?displayProperty=fullName> object as its parameter.
481465

482-
### Code
483-
484466
```cpp
485467
// managed_lambda_expression.cpp
486468
// compile with: /clr
@@ -498,7 +480,7 @@ int main()
498480
}
499481
```
500482

501-
### Output
483+
The example produces this output:
502484

503485
```Output
504486
Hello!

docs/dotnet/dotnet-programming-with-cpp-cli-visual-cpp.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ C++/CLI itself isn't installed by default when you install a Visual Studio C++ w
2323
::: moniker range="msvc-160"
2424

2525
In Visual Studio 2019, the default target framework for .NET Core projects is 5.0. For .NET Frameworks projects, the default is 4.7.2. The .NET Framework version selector is on the **Configure your new project** page of the **Create a new project** dialog.
26+
2627
## Install C++/CLI support in Visual Studio 2019
2728

2829
C++/CLI itself isn't installed by default when you install a Visual Studio C++ workload. To install the component after Visual Studio is installed, open the Visual Studio Installer. Choose the **Modify** button next to your installed version of Visual Studio. Select the **Installed components** tab. Scroll down to the **Compilers, build tools, and runtimes** section, and select the latest **C++/CLI support for v142 build tools** component. Choose **Modify** to update Visual Studio.

0 commit comments

Comments
 (0)