Skip to content

Commit 055b609

Browse files
Merge pull request #5503 from Rageking8/fix-syntax-error-and-format-code-in-postfix-increment-and-decrement-operators
Fix syntax error and format code in "Postfix Increment and Decrement Operators"
2 parents 3d2b34f + 3833dac commit 055b609

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

docs/cpp/postfix-increment-and-decrement-operators-increment-and-decrement.md

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
---
2-
description: "Learn more about: Postfix Increment and Decrement Operators: ++ and --"
32
title: "Postfix Increment and Decrement Operators: ++ and --"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Postfix Increment and Decrement Operators: ++ and --"
4+
ms.date: 11/04/2016
55
f1_keywords: ["--", "++"]
66
helpviewer_keywords: ["increment operators [C++], syntax", "member-selection operators [C++]", "-- operator [C++], postfix decrement operators", "postfix operators [C++]", "++ operator [C++], postfix increment operators", "decrement operators [C++], syntax", "operators [C++], postfix", "decrement operators [C++]"]
7-
ms.assetid: 0204d5c8-51b0-4108-b8a1-074c5754d89c
87
---
98
# Postfix Increment and Decrement Operators: `++` and `--`
109

@@ -43,19 +42,25 @@ The following code illustrates the postfix increment operator:
4342
#include <iostream>
4443
using namespace std;
4544

46-
int main() {
47-
int i = 10;
48-
cout << i++ << endl;
49-
cout << i << endl;
45+
int main()
46+
{
47+
int i = 10;
48+
cout << i++ << endl;
49+
cout << i << endl;
5050
}
5151
```
5252

53+
```Output
54+
10
55+
11
56+
```
57+
5358
Postincrement and postdecrement operations on enumerated types are not supported:
5459

5560
```cpp
56-
enum Compass { North, South, East, West );
61+
enum Compass { North, South, East, West };
5762
Compass myCompass;
58-
for( myCompass = North; myCompass != West; myCompass++ ) // Error
63+
for (myCompass = North; myCompass != West; myCompass++); // Error
5964
```
6065
6166
## See also

0 commit comments

Comments
 (0)