Skip to content

Commit 2bebb9e

Browse files
jimmybenzColin Robertson
authored andcommitted
Update to lvalues-and-rvalues-visual-cpp.md (MicrosoftDocs#575)
Update to the example code for lvalue and rvalues to help make the topic easier to understand.
1 parent 34eb50b commit 2bebb9e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/cpp/lvalues-and-rvalues-visual-cpp.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ int main()
4646
// Correct usage: the dereferenced pointer is an lvalue.
4747
*p = i;
4848

49-
const int ci = 7;
50-
// Incorrect usage: the variable is a non-modifiable lvalue (C3892).
51-
ci = 9; // C3892
52-
5349
// Correct usage: the conditional operator returns an lvalue.
5450
((i < 3) ? i : j) = 7;
51+
52+
// Incorrect usage: the constant ci is a non-modifiable lvalue (C3892).
53+
const int ci = 7;
54+
ci = 9; // C3892
5555
}
5656
```
5757

0 commit comments

Comments
 (0)