Skip to content

Commit 7593dc8

Browse files
author
Colin Robertson
authored
Merge branch 'master' into cr-zc-alignednew
2 parents ae7cbfa + 531ac4f commit 7593dc8

File tree

12 files changed

+260
-254
lines changed

12 files changed

+260
-254
lines changed

docs/TOC.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# [Visual C++ in Visual Studio 2017](visual-cpp-in-visual-studio.md)
22
# [What's New for Visual C++ in Visual Studio 2017](what-s-new-for-visual-cpp-in-visual-studio.md)
3+
# [Visual C++ Tutorial](build/vscpp-step-0-installation.md)
4+
## [Install C++ support in Visual Studio](build/vscpp-step-0-installation.md)
5+
## [Create a C++ console app project](build/vscpp-step-1-create.md)
6+
## [Build and run a C++ console app project](build/vscpp-step-2-build.md)
37
# [C++ conformance improvements in Visual Studio 2017](cpp-conformance-improvements-2017.md)
48
## [Visual C++ Language Conformance](visual-cpp-language-conformance.md)
59
# [Supported Platforms (Visual C++)](supported-platforms-visual-cpp.md)

docs/build/vscpp-step-0-installation.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
2-
title: Step 0 - Install C++ support in Visual Studio | Microsoft Docs
2+
title: Install C++ support in Visual Studio | Microsoft Docs
33
description: "Install Visual Studio support for Visual C++"
44
ms.custom: "mvc"
5-
ms.date: 10/17/2017
5+
ms.date: 12/12/2017
66
ms.topic: "get-started-article"
77
ms.technology:
88
- "devlang-C++"
@@ -70,6 +70,6 @@ When Visual Studio is running, you are ready to continue to the next step.
7070
## Next Steps
7171

7272
> [!div class="nextstepaction"]
73-
> [Step 1: Create a C++ project](vscpp-step-1-create.md)
73+
> [Create a C++ project](vscpp-step-1-create.md)
7474
7575
<iframe src="" height="0" width="0" frameborder="0" name="frameTarget" />

docs/build/vscpp-step-1-create.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
2-
title: Step 1 - Create a C++ console app project | Microsoft Docs
2+
title: Create a C++ console app project | Microsoft Docs
33
description: "Install Visual Studio support for Visual C++"
44
ms.custom: "mvc"
5-
ms.date: 10/17/2017
5+
ms.date: 12/12/2017
66
ms.topic: "get-started-article"
77
ms.technology:
88
- "devlang-C++"
@@ -19,7 +19,7 @@ The usual starting point for a C++ programmer is a "Hello, world!" application t
1919

2020
## Prerequisites
2121

22-
- Have Visual Studio with the Desktop development with C++ workload installed and running on your computer. If it's not installed yet, see [Step 0 - Install C++ support in Visual Studio](../build/vscpp-step-0-installation.md).
22+
- Have Visual Studio with the Desktop development with C++ workload installed and running on your computer. If it's not installed yet, see [Install C++ support in Visual Studio](../build/vscpp-step-0-installation.md).
2323

2424
## Create your app project
2525

@@ -88,7 +88,7 @@ When the code looks like this in the editor, you're ready to go on to the next s
8888
## Next Steps
8989
9090
> [!div class="nextstepaction"]
91-
> [Step 2: Build and run a C++ project](vscpp-step-2-build.md)
91+
> [Build and run a C++ project](vscpp-step-2-build.md)
9292
9393
## Troubleshooting guide
9494

docs/build/vscpp-step-2-build.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
2-
title: Step 2 - Build and run a C++ console app project | Microsoft Docs
2+
title: Build and run a C++ console app project | Microsoft Docs
33
description: "Install Visual Studio support for Visual C++"
44
ms.custom: "mvc"
5-
ms.date: 10/17/2017
5+
ms.date: 12/12/2017
66
ms.topic: "get-started-article"
77
ms.technology:
88
- "devlang-C++"
@@ -19,9 +19,9 @@ When you've created a C++ console app project and entered your code, you can bui
1919

2020
## Prerequisites
2121

22-
- Have Visual Studio with the Desktop development with C++ workload installed and running on your computer. If it's not installed yet, follow the steps in [Step 0 - Install C++ support in Visual Studio](../build/vscpp-step-0-installation.md).
22+
- Have Visual Studio with the Desktop development with C++ workload installed and running on your computer. If it's not installed yet, follow the steps in [Install C++ support in Visual Studio](../build/vscpp-step-0-installation.md).
2323

24-
- Create a "Hello, World!" project and enter its source code. If you haven't done this yet, follow the steps in [Step 1 - Create a C++ console app project](../build/vscpp-step-1-create.md).
24+
- Create a "Hello, World!" project and enter its source code. If you haven't done this yet, follow the steps in [Create a C++ console app project](../build/vscpp-step-1-create.md).
2525

2626
If Visual Studio looks like this, you're ready to build and run your app:
2727

@@ -63,7 +63,7 @@ Congratulations, you've built and run a console app in Visual Studio!
6363

6464
## Next Steps
6565

66-
Once you've built and run this simple app, you're ready for more complex projects. See the Quickstarts, Tutorials, and Sample Code for examples of the things you can do in C++ using Visual Studio.
66+
Once you've built and run this simple app, you're ready for more complex projects. See [Using the Visual Studio IDE for C++ Desktop Development](../ide/using-the-visual-studio-ide-for-cpp-desktop-development.md) for more detailed walkthroughs that explore the capabilities of Visual C++ in Visual Studio.
6767

6868
## Troubleshooting guide
6969

docs/c-language/precedence-and-order-of-evaluation.md

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@ The precedence and associativity of C operators affect the grouping and evaluati
2020

2121
The following table summarizes the precedence and associativity (the order in which the operands are evaluated) of C operators, listing them in order of precedence from highest to lowest. Where several operators appear together, they have equal precedence and are evaluated according to their associativity. The operators in the table are described in the sections beginning with [Postfix Operators](../c-language/postfix-operators.md). The rest of this section gives general information about precedence and associativity.
2222

23-
### Precedence and Associativity of C Operators
23+
## Precedence and Associativity of C Operators
2424

25-
|Symbol1|Type of Operation|Associativity|
25+
|Symbol <sup>1</sup>|Type of Operation|Associativity|
2626
|-------------|-----------------------|-------------------|
27-
|**[ ] ( ) . ->** postfix `++` and postfix **--**|Expression|Left to right|
28-
|prefix `++` and prefix **-- sizeof & \* + - ~ !**|Unary|Right to left|
27+
|**\[ ] ( ) . ->**<br /><br />**++** **--** (postfix)|Expression|Left to right|
28+
**sizeof & \* + - ~ !**<br /><br />**++ --** (prefix)|Unary|Right to left|
2929
|*typecasts*|Unary|Right to left|
3030
|**\* / %**|Multiplicative|Left to right|
3131
|**+ -**|Additive|Left to right|
32-
|**<\< >>**|Bitwise shift|Left to right|
32+
|**\<\< >>**|Bitwise shift|Left to right|
3333
|**\< > \<= >=**|Relational|Left to right|
3434
|**== !=**|Equality|Left to right|
3535
|**&**|Bitwise-AND|Left to right|
@@ -38,7 +38,7 @@ The precedence and associativity of C operators affect the grouping and evaluati
3838
|**&&**|Logical-AND|Left to right|
3939
|**&#124;&#124;**|Logical-OR|Left to right|
4040
|**? :**|Conditional-expression|Right to left|
41-
|**= \*= /= %=**<br /><br /> **+= -= <\<= >>=&=**<br /><br /> **^= &#124;=**|Simple and compound assignment2|Right to left|
41+
|**= \*= /= %=**<br /><br /> **+= -= \<\<= >>= &=**<br /><br /> **^= &#124;=**|Simple and compound assignment <sup>2</sup>|Right to left|
4242
|**,**|Sequential evaluation|Left to right|
4343

4444
1. Operators are listed in descending order of precedence. If several operators appear on the same line or in a group, they have equal precedence.
@@ -51,22 +51,20 @@ The precedence and associativity of C operators affect the grouping and evaluati
5151

5252
Logical operators also guarantee evaluation of their operands from left to right. However, they evaluate the smallest number of operands needed to determine the result of the expression. This is called "short-circuit" evaluation. Thus, some operands of the expression may not be evaluated. For example, in the expression
5353

54-
```
55-
x && y++
56-
```
54+
`x && y++`
5755

5856
the second operand, `y++`, is evaluated only if `x` is true (nonzero). Thus, `y` is not incremented if `x` is false (0).
5957

60-
**Examples**
58+
## Examples
6159

6260
The following list shows how the compiler automatically binds several sample expressions:
63-
61+
6462
|Expression|Automatic Binding|
6563
|----------------|-----------------------|
66-
|`a & b &#124;&#124; c`|`(a & b) &#124;&#124; c`|
67-
|`a = b &#124;&#124; c`|`a = (b &#124;&#124; c)`|
68-
|`q && r &#124;&#124; s--`|`(q && r) &#124;&#124; s--`|
69-
64+
|a & b &#124;&#124; c|(a & b) &#124;&#124; c|
65+
|a = b &#124;&#124; c|a = (b &#124;&#124; c)|
66+
|q && r &#124;&#124; s--|(q && r) &#124;&#124; s--|
67+
7068
In the first expression, the bitwise-AND operator (`&`) has higher precedence than the logical-OR operator (`||`), so `a & b` forms the first operand of the logical-OR operation.
7169

7270
In the second expression, the logical-OR operator (`||`) has higher precedence than the simple-assignment operator (`=`), so `b || c` is grouped as the right-hand operand in the assignment. Note that the value assigned to `a` is either 0 or 1.
@@ -77,13 +75,11 @@ x && y++
7775

7876
|Illegal Expression|Default Grouping|
7977
|------------------------|----------------------|
80-
|`p == 0 ? p += 1: p += 2`|`( p == 0 ? p += 1 : p ) += 2`|
78+
|p == 0 ? p += 1: p += 2|( p == 0 ? p += 1 : p ) += 2|
8179

8280
In this expression, the equality operator (`==`) has the highest precedence, so `p == 0` is grouped as an operand. The conditional-expression operator (`? :`) has the next-highest precedence. Its first operand is `p == 0`, and its second operand is `p += 1`. However, the last operand of the conditional-expression operator is considered to be `p` rather than `p += 2`, since this occurrence of `p` binds more closely to the conditional-expression operator than it does to the compound-assignment operator. A syntax error occurs because `+= 2` does not have a left-hand operand. You should use parentheses to prevent errors of this kind and produce more readable code. For example, you could use parentheses as shown below to correct and clarify the preceding example:
8381

84-
```
85-
( p == 0 ) ? ( p += 1 ) : ( p += 2 )
86-
```
82+
`( p == 0 ) ? ( p += 1 ) : ( p += 2 )`
8783

8884
## See Also
8985
[C Operators](../c-language/c-operators.md)

0 commit comments

Comments
 (0)