You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -31,7 +31,7 @@ In this walkthrough, you watch the value of a variable as the program runs and d
31
31
32
32
1. On the menu bar, choose **Debug** > **Start Debugging**, or choose the **F5** key.
33
33
34
-
When the program reaches the line that has the breakpoint, execution stops temporarily, because your program is in Break mode. A yellow arrow to the left of a line of code indicates that it's the next line to be executed.
34
+
Because your program is in Break mode, execution pauses when it reaches the breakpoint line. A yellow arrow to the left of a line of code indicates that it's the next line to be executed.
35
35
36
36
1. To examine the value of the `Cardgame::totalParticipants` variable, move the pointer over `Cardgame` and then move it over the expansion control at the left of the tooltip window. The variable name `totalParticipants` and its value of **12** are displayed.
37
37
@@ -43,16 +43,16 @@ In this walkthrough, you watch the value of a variable as the program runs and d
43
43
44
44
1. Open the shortcut menu for the `return 0;` statement and then choose **Run to Cursor**. The yellow arrow to the left of the code points to the next statement to be executed.
45
45
46
-
1. The `Cardgame::totalParticipants` number should decrease when a `Cardgame` ends. At this point, `Cardgame::totalParticipants` should equal 0 because all `Cardgame` instances have been deleted, but the **Watch 1** window indicates that `Cardgame::totalparticipants` equals **18**. The difference indicates that there's a bug in the code, which you can detect and fix by completing the next walkthrough, [Walkthrough: Debugging a Project (C++)](../ide/walkthrough-debugging-a-project-cpp.md).
46
+
1. The `Cardgame::totalParticipants` number should decrease when a `Cardgame` ends. At this point, `Cardgame::totalParticipants` should equal 0 because all `Cardgame` instances have been deleted, but the **Watch 1** window indicates that `Cardgame::totalparticipants` equals **18**. The difference indicates that there's a bug in the code. You can detect and fix it by completing the next walkthrough, [Walkthrough: Debugging a Project (C++)](../ide/walkthrough-debugging-a-project-cpp.md).
47
47
48
48
1. To stop the program, on the menu bar, choose **Debug** > **Stop Debugging**, or choose the **Shift**+**F5** keyboard shortcut.
49
49
50
50
## Next Steps
51
51
52
-
**Previous:**[Walkthrough: Building a Project (C++)](../ide/walkthrough-building-a-project-cpp.md)<br/>
52
+
**Previous:**[Walkthrough: Building a Project (C++)](../ide/walkthrough-building-a-project-cpp.md)\
53
53
**Next:**[Walkthrough: Debugging a Project (C++)](../ide/walkthrough-debugging-a-project-cpp.md)
54
54
55
55
## See also
56
56
57
-
[C++ Language Reference](../cpp/cpp-language-reference.md)<br/>
58
-
[Projects and build systems](../build/projects-and-build-systems-cpp.md)<br/>
57
+
[C++ Language Reference](../cpp/cpp-language-reference.md)\
58
+
[Projects and build systems](../build/projects-and-build-systems-cpp.md)
By default, **`fp_contract`** is **`off`**, which tells the compiler to preserve individual floating-point instructions. Set **`fp_contract`** to **`on`** to use floating-point contraction instructions where possible. This behavior is new in Visual Studio 2022. In previous compiler versions **`fp_contract`** defaulted to **`on`**.
21
+
By default, **`fp_contract`** is **`off`**, which tells the compiler to preserve individual floating-point instructions. Set **`fp_contract`** to **`on`** to use floating-point contraction instructions where possible. This behavior is new in Visual Studio 2022 version 17.0. In previous compiler versions,**`fp_contract`** defaulted to **`on`**.
22
22
23
23
::: moniker-end
24
24
::: moniker range="<=msvc-160"
25
25
26
-
By default, **`fp_contract`** is **`on`**. This tells the compiler to use floating-point contraction instructions where possible. Set **`fp_contract`** to **`off`** to preserve individual floating-point instructions.
26
+
By default, **`fp_contract`** is **`on`**. This setting tells the compiler to use floating-point contraction instructions where possible. Set **`fp_contract`** to **`off`** to preserve individual floating-point instructions. In Visual Studio 2022 version 17.0 and later, **`fp_contract`** defaults to **`off`**.
27
27
28
28
::: moniker-end
29
29
30
-
By default, **`fp_contract`** is **`off`**. This tells the compiler to preserve individual floating-point instructions. Set **`fp_contract`** to **`on`** to use floating-point contraction instructions where possible.
31
-
32
30
For more information on floating-point behavior, see [`/fp` (Specify floating-point behavior)](../build/reference/fp-specify-floating-point-behavior.md).
33
31
34
32
Other floating-point pragma directives include:
@@ -39,12 +37,11 @@ Other floating-point pragma directives include:
39
37
40
38
## Example
41
39
42
-
The code generated from this sample does not use a fused-multiply-add instruction even when it is available on the target processor. If you comment out `#pragma fp_contract (off)`, the generated code may use a fused-multiply-add instruction if it is available.
40
+
The **`/fp:fast`** compiler option enables contractions by default, but the `#pragma fp_contract (off)` directive in this example turns them off. The code generated from this sample won't use a fused-multiply-add instruction even when it's available on the target processor. If you comment out `#pragma fp_contract (off)`, the generated code may use a fused-multiply-add instruction if it's available.
43
41
44
42
```cpp
45
43
// pragma_directive_fp_contract.cpp
46
44
// on x86 and x64 compile with: /O2 /fp:fast /arch:AVX2
@@ -142,7 +142,7 @@ Quotation marks and back-slashes should be escaped, as shown above. A pragma str
142
142
143
143
The following code example demonstrates how the **`_Pragma`** keyword could be used in an assert-like macro. It creates a pragma directive that suppresses a warning when the condition expression happens to be constant.
144
144
145
-
The macro definition uses the `do`-`while(0)` idiom for multi-statement macros so that it can be used as though it were one statement. For more information, see [C multi-line macro](https://stackoverflow.com/questions/1067226/c-multi-line-macro-do-while0-vs-scope-block) on Stack Overflow. The **`_Pragma`** statement only applies to the line of code that follows it.
145
+
The macro definition uses the `do`-`while(0)` idiom for multi-statement macros so that it can be used as though it were one statement. For more information, see [C multi-line macro](https://stackoverflow.com/questions/1067226/c-multi-line-macro-do-while0-vs-scope-block) on Stack Overflow. The **`_Pragma`** statement in the example only applies to the line of code that follows it.
0 commit comments