Skip to content

Commit 122bbb4

Browse files
author
Michael Blome
committed
more formatting through s*
1 parent 79cc5de commit 122bbb4

31 files changed

+93
-95
lines changed

docs/cpp/raise.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ Emphasizes the call site of an event.
1919

2020
```
2121
22-
__raise
23-
method-declarator
24-
;
22+
__raise method-declarator;
2523
2624
```
2725

@@ -35,7 +33,7 @@ method-declarator
3533
3634
## Example
3735

38-
```
36+
```cpp
3937
// EventHandlingRef_raise.cpp
4038
struct E {
4139
__event void func1();

docs/cpp/raising-software-exceptions.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@ Some of the most common sources of program errors are not flagged as exceptions
3636

3737
The resulting error code should therefore have the highest four bits set to hexadecimal E. For example, the following definitions define exception codes that do not conflict with any Windows exception codes. (You may, however, need to check which codes are used by third-party DLLs.)
3838

39-
```
39+
```cpp
4040
#define STATUS_INSUFFICIENT_MEM 0xE0000001
4141
#define STATUS_FILE_BAD_FORMAT 0xE0000002
4242
```
4343

4444
After you have defined an exception code, you can use it to raise an exception. For example, the following code raises the STATUS_INSUFFICIENT_MEM exception in response to a memory allocation problem:
4545

46-
```
46+
```cpp
4747
lpstr = _malloc( nBufferSize );
4848
if (lpstr == NULL)
4949
RaiseException( STATUS_INSUFFICIENT_MEM, 0, 0, 0);
@@ -53,7 +53,7 @@ if (lpstr == NULL)
5353
5454
In your exception-handling filters, you can then test for the codes you've defined. For example:
5555
56-
```
56+
```cpp
5757
__try {
5858
...
5959
}

docs/cpp/range-based-for-statement-cpp.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Executes `statement` repeatedly and sequentially for each element in `expression
1717

1818
```
1919
20-
for ( for-range-declaration : expression )
20+
for ( for-range-declaration : expression )
2121
   statement
2222
```
2323

@@ -85,21 +85,23 @@ int main()
8585
```
8686

8787
Here is the output:
88+
89+
```Output
90+
1 2 3 4 5 6 7 8 9 10
8891
89-
`1 2 3 4 5 6 7 8 9 10`
90-
91-
`1 2 3 4 5 6 7 8 9 10`
92+
1 2 3 4 5 6 7 8 9 10
9293
93-
`1 2 3 4 5 6 7 8 9 10`
94+
1 2 3 4 5 6 7 8 9 10
9495
95-
`1 2 3 4 5 6 7 8 9 10`
96+
1 2 3 4 5 6 7 8 9 10
9697
9798
`end of integer array test`
9899
99100
`0.14159 1.14159 2.14159 3.14159 4.14159 5.14159 6.14159 7.14159 8.14159 9.14159`
100101
101102
`end of vector test`
102-
103+
```
104+
103105
A range-based `for` loop terminates when one of these in `statement` is executed: a [break](../cpp/break-statement-cpp.md), [return](../cpp/return-statement-cpp.md), or [goto](../cpp/goto-statement-cpp.md) to a labeled statement outside the range-based **for** loop. A [continue](../cpp/continue-statement-cpp.md) statement in a range-based `for` loop terminates only the current iteration.
104106

105107
Keep in mind these facts about range-based `for`:

docs/cpp/reference-type-function-arguments.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ ms.workload: ["cplusplus"]
1414
# Reference-Type Function Arguments
1515
It is often more efficient to pass references, rather than large objects, to functions. This allows the compiler to pass the address of the object while maintaining the syntax that would have been used to access the object. Consider the following example that uses the `Date` structure:
1616

17-
```
17+
```cpp
1818
// reference_type_function_arguments.cpp
1919
struct Date
2020
{
@@ -57,7 +57,7 @@ int main()
5757
5858
Although arguments passed as reference types observe the syntax of non-pointer types, they retain one important characteristic of pointer types: they are modifiable unless declared as **const**. Because the intent of the preceding code is not to modify the object `GDate`, a more appropriate function prototype is:
5959
60-
```
60+
```cpp
6161
long JulianFromGregorian( const Date& GDate );
6262
```
6363

docs/cpp/reference-type-function-returns.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Functions can be declared to return a reference type. There are two reasons to m
2727
## Example
2828
Consider the `Point` example:
2929

30-
```
30+
```cpp
3131
// refType_function_returns.cpp
3232
// compile with: /EHsc
3333

@@ -71,7 +71,7 @@ cout << "x = " << ThePoint.x() << "\n"
7171

7272
## Output
7373

74-
```
74+
```Output
7575
x = 7
7676
y = 9
7777
```
@@ -93,7 +93,7 @@ y = 9
9393
## Caution returning address of local
9494
If you declare an object at local scope, that object will be destroyed when the function returns. If the function returns a reference to that object, that reference will probably cause an access violation at runtime if the caller attempts to use the null reference.
9595

96-
```
96+
```cpp
9797
// C4172 means Don’t do this!!!
9898
Foo& GetFoo()
9999
{

docs/cpp/references-cpp.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,14 @@ A reference, like a pointer, stores the address of an object that is located els
5454

5555
Multiple declarators and initializers may appear in a comma-separated list following a single declaration specifier. For example:
5656

57-
```
57+
```cpp
5858
int &i;
5959
int &i, &j;
6060
```
6161

6262
References, pointers and objects may be declared together:
6363

64-
```
64+
```cpp
6565
int &ref, *ptr, k;
6666
```
6767

@@ -71,7 +71,7 @@ int &ref, *ptr, k;
7171

7272
## Example
7373

74-
```
74+
```cpp
7575
// references.cpp
7676
#include <stdio.h>
7777
struct S {

docs/cpp/references-to-pointers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ References to pointers can be declared in much the same way as references to obj
1919

2020
Functions `Add1` and `Add2` are functionally equivalent (although they are not called the same way). The difference is that `Add1` uses double indirection whereas `Add2` uses the convenience of a reference to a pointer.
2121

22-
```
22+
```cpp
2323
// references_to_pointers.cpp
2424
// compile with: /EHsc
2525

docs/cpp/reinterpret-cast-operator.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ reinterpret_cast < type-id > ( expression )
3434

3535
One practical use of `reinterpret_cast` is in a hash function, which maps a value to an index in such a way that two distinct values rarely end up with the same index.
3636

37-
```
37+
```cpp
3838
#include <iostream>
3939
using namespace std;
4040

docs/cpp/relational-function-templates.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ ms.workload: ["cplusplus"]
1818

1919
```
2020
21-
template<typename _InterfaceType> bool operator==(
21+
template<typename _InterfaceType> bool operator==(
2222
int NULL,
2323
_com_ptr_t<_InterfaceType>& p
2424
);

docs/cpp/relational-operators-equal-and-equal.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ expression >= expression
3737

3838
## Example
3939

40-
```
40+
```cpp
4141
// expre_Relational_Operators.cpp
4242
// compile with: /EHsc
4343
#include <iostream>
@@ -54,7 +54,7 @@ int main() {
5454

5555
The expressions in the preceding example must be enclosed in parentheses because the stream insertion operator (**<<**) has higher precedence than the relational operators. Therefore, the first expression without the parentheses would be evaluated as:
5656

57-
```
57+
```cpp
5858
(cout << "The true expression 3 > 2 yields: " << 3) < (2 << "\n");
5959
```
6060

0 commit comments

Comments
 (0)