Skip to content

Commit 0740262

Browse files
author
Michael Blome
committed
proofread pass
1 parent 737e1df commit 0740262

10 files changed

+37
-32
lines changed

docs/cpp/aliases-and-typedefs-cpp.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -263,11 +263,11 @@ int main()
263263
ms.f = 0.99;
264264
printf_s("%d %f\n", ms.i, ms.f);
265265
}
266-
```cpp
266+
```
267267

268268
```Output
269269
10 0.990000
270-
```cpp
270+
```
271271

272272
### Re-declaration of typedefs
273273
The `typedef` declaration can be used to redeclare the same name to refer to the same type. For example:
@@ -282,7 +282,7 @@ typedef char CHAR;
282282
// PROG.CPP
283283
#include "file1.h"
284284
#include "file2.h" // OK
285-
```cpp
285+
```
286286

287287
The program PROG.CPP includes two header files, both of which contain `typedef` declarations for the name `CHAR`. As long as both declarations refer to the same type, such redeclaration is acceptable.
288288

@@ -291,7 +291,7 @@ typedef char CHAR;
291291
```cpp
292292
// FILE2.H
293293
typedef int CHAR; // Error
294-
```cpp
294+
```
295295

296296
the compiler issues an error because of the attempt to redeclare the name `CHAR` to refer to a different type. This extends to constructs such as:
297297

@@ -304,7 +304,7 @@ typedef union REGS // OK: name REGS redeclared
304304
struct wordregs x; // same meaning.
305305
struct byteregs h;
306306
} REGS;
307-
```cpp
307+
```
308308

309309
### typedefs in C++ vs. C
310310
Use of the `typedef` specifier with class types is supported largely because of the ANSI C practice of declaring unnamed structures in `typedef` declarations. For example, many C programmers use the following:
@@ -317,13 +317,13 @@ typedef struct { // Declare an unnamed structure and give it the
317317
unsigned x;
318318
unsigned y;
319319
} POINT;
320-
```cpp
320+
```
321321

322322
The advantage of such a declaration is that it enables declarations like:
323323

324-
```
324+
```cpp
325325
POINT ptOrigin;
326-
```cpp
326+
```
327327

328328
instead of:
329329

docs/cpp/assignment.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ The assignment operator (**=**) is, strictly speaking, a binary operator. Its de
2222

2323
The following example illustrates how to declare an assignment operator:
2424

25-
```
25+
```cpp
2626
// assignment.cpp
2727
class Point
2828
{
@@ -47,7 +47,7 @@ int main()
4747

4848
Note that the supplied argument is the right side of the expression. The operator returns the object to preserve the behavior of the assignment operator, which returns the value of the left side after the assignment is complete. This allows writing statements such as:
4949

50-
```
50+
```cpp
5151
pt1 = pt2 = pt3;
5252
```
5353

docs/cpp/bitwise-and-operator-amp.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,14 @@ ms.author: "mblome"
1313
ms.workload: ["cplusplus"]
1414
---
1515
# Bitwise AND Operator: &
16+
1617
## Syntax
1718

18-
```
19-
20-
expression
21-
&
22-
expression
23-
24-
```
19+
```
20+
21+
expression & expression
22+
23+
```
2524

2625
## Remarks
2726
The expressions may be other and-expressions, or (subject to the type restrictions mentioned below) equality expressions, relational expressions, additive expressions, multiplicative expressions, pointer to member expressions, cast expressions, unary expressions, postfix expressions, or primary expressions.

docs/cpp/bitwise-inclusive-or-operator-pipe.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ ms.workload: ["cplusplus"]
1717

1818
```
1919
20-
expression
21-
|
22-
expression
20+
expression | expression
2321
2422
```
2523

docs/cpp/explicit-type-conversion-operator-parens.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,16 @@ d = float( i );
9393

9494
Explicit type conversions can also be specified using the "cast" syntax. The previous example, rewritten using the cast syntax, is:
9595

96-
```cpp
96+
```cpp
97+
9798
d = (float)i;
99+
98100
```
99101

100102
Both cast and function-style conversions have the same results when converting from single values. However, in the function-style syntax, you can specify more than one argument for conversion. This difference is important for user-defined types. Consider a `Point` class and its conversions:
101103

102-
```cpp
104+
```cpp
105+
103106
struct Point
104107
{
105108
Point( short x, short y ) { _x = x; _y = y; }
@@ -108,7 +111,8 @@ struct Point
108111
};
109112
...
110113
Point pt = Point( 3, 10 );
111-
```cpp
114+
115+
```
112116
113117
The preceding example, which uses function-style conversion, shows how to convert two values (one for *x* and one for *y*) to the user-defined type `Point`.
114118

docs/cpp/if-else-statement-cpp.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,10 @@ else // optional
5858
...
5959
}
6060
```
61+
6162
## Example
62-
```
63+
64+
```cpp
6365
// if_else_statement.cpp
6466
#include <iostream>
6567

docs/cpp/increment-and-decrement-operator-overloading-cpp.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ The increment and decrement operators fall into a special category because there
2525
2626
The following example shows how to define prefix and postfix increment and decrement operators for the `Point` class:
2727

28-
```
28+
```cpp
2929
// increment_and_decrement1.cpp
3030
class Point
3131
{
@@ -86,7 +86,7 @@ int main()
8686

8787
The same operators can be defined in file scope (globally) using the following function heads:
8888

89-
```
89+
```cpp
9090
friend Point& operator++( Point& ) // Prefix increment
9191
friend Point& operator++( Point&, int ) // Postfix increment
9292
friend Point& operator--( Point& ) // Prefix decrement
@@ -95,7 +95,7 @@ friend Point& operator--( Point&, int ) // Postfix decrement
9595

9696
The argument of type `int` that denotes the postfix form of the increment or decrement operator is not commonly used to pass arguments. It usually contains the value 0. However, it can be used as follows:
9797

98-
```
98+
```cpp
9999
// increment_and_decrement2.cpp
100100
class Int
101101
{

docs/cpp/move-constructors-and-move-assignment-operators-cpp.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,8 @@ In ~MemoryBlock(). length = 75. Deleting resource.
293293

294294
If you provide both a move constructor and a move assignment operator for your class, you can eliminate redundant code by writing the move constructor to call the move assignment operator. The following example shows a revised version of the move constructor that calls the move assignment operator:
295295

296-
```
296+
```cpp
297+
297298
// Move constructor.
298299
MemoryBlock(MemoryBlock&& other)
299300
: _data(nullptr)

docs/cpp/overview-of-declarators.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ int a, *b, c[5], **d, &e=a;
159159
- qualified-name 
160160
- declarator ( argument-list ) [cv-qualfiers] [exception-spec]
161161
- declarator [ [ constant-expression ] ]
162-
- pointer-operatordeclarator 
162+
- pointer-operator declarator 
163163
- ( declarator )
164164

165165

docs/cpp/primary-expressions.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ Primary expressions are the building blocks of more complex expressions. They ar
1616

1717
```
1818
19-
literal
20-
this
21-
:: namename( expression )
19+
literal
20+
this
21+
name
22+
::name ( expression )
2223
```
2324

2425
A *literal* is a constant primary expression. Its type depends on the form of its specification. See [Literals](../cpp/numeric-boolean-and-pointer-literals-cpp.md) for complete information about specifying literals.

0 commit comments

Comments
 (0)