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
@@ -53,9 +53,6 @@ If you need to install the workload but already have Visual Studio, go to **Tool
53
53
54
54
First, you'll create a C++ console application project. The project type comes with all the template files you'll need, before you've even added anything!
55
55
56
-
57
-
::: moniker range=">=vs-2019"
58
-
59
56
1. Open Visual Studio.
60
57
61
58
If the start window is not open, choose **File** > **Start Window**.
@@ -66,7 +63,12 @@ First, you'll create a C++ console application project. The project type comes w
66
63
67
64
After you apply the language and platform filters, choose the **Console App** template, and then choose **Next**.
68
65
69
-

66
+
::: moniker range=">= vs-2022"
67
+

68
+
::: moniker-end
69
+
::: moniker range="vs-2019"
70
+

71
+
::: moniker-end
70
72
71
73
> [!NOTE]
72
74
> If you do not see the **Console App** template, you can install it from the **Create a new project** window. In the **Not finding what you're looking for?** message, choose the **Install more tools and features** link. Then, in the Visual Studio Installer, choose the **Desktop development with C++** workload.
@@ -75,8 +77,6 @@ First, you'll create a C++ console application project. The project type comes w
75
77
76
78
Visual Studio opens your new project.
77
79
78
-
::: moniker-end
79
-
80
80
## Create the application
81
81
82
82
1. In *get-started-debugging.cpp*, replace all of the default code with the following code instead:
@@ -146,7 +146,7 @@ First, you'll create a C++ console application project. The project type comes w
146
146
147
147
2. Press **F5** or the **Start Debugging** button , the app starts, and the debugger runs to the line of code where you set the breakpoint.
148
148
149
-

149
+

150
150
151
151
The yellow arrow represents the statement on which the debugger paused, which also suspends app execution at the same point (this statement has not yet executed).
152
152
@@ -168,7 +168,7 @@ Mostly, we use the keyboard shortcuts here, because it's a good way to get fast
168
168
169
169
The yellow pointer advances into the `SendMessage` method.
170
170
171
-

171
+

172
172
173
173
F11 is the **Step Into** command and advances the app execution one statement at a time. F11 is a good way to examine the execution flow in the most detail. (To move faster through code, we show you some other options also.) By default, the debugger skips over non-user code (if you want more details, see [Just My Code](../debugger/just-my-code.md)).
174
174
@@ -184,7 +184,7 @@ Mostly, we use the keyboard shortcuts here, because it's a good way to get fast
184
184
185
185
1. While paused at the method call, press **F10** (or choose **Debug > Step Over**) once.
186
186
187
-

187
+

188
188
189
189
Notice this time that the debugger does not step into the `SendMessage` method. **F10** advances the debugger without stepping into functions or methods in your app code (the code still executes). By pressing **F10** on the `SendMessage` method call (instead of **F11**), we skipped over the implementation code for `SendMessage` (which maybe we're not interested in right now). For more information on different ways to move through your code, see [Navigate code in the debugger](../debugger/navigating-through-code-with-the-debugger.md).
190
190
@@ -194,7 +194,7 @@ Mostly, we use the keyboard shortcuts here, because it's a good way to get fast
194
194
195
195
1. In the code editor, scroll down and hover over the `std::wcout` function in the `SendMessage` method until the green **Run to Click** button  appears on the left. The tooltip for the button shows "Run execution to here".
196
196
197
-

197
+

198
198
199
199
> [!NOTE]
200
200
> The **Run to Click** button is new in [!include[vs_dev15](../misc/includes/vs_dev15_md.md)]. (If you don't see the green arrow button, use **F11** in this example instead to advance the debugger to the right place.)
@@ -225,7 +225,7 @@ Features that allow you to inspect variables are one of the most useful features
225
225
226
226
1. Press **F5** (or **Debug** > **Continue**) a few times to iterate several times through the `for` loop, pausing again at the breakpoint, and hovering over the `name` variable each time to check its value.
227
227
228
-

228
+

229
229
230
230
The value of the variable changes with each iteration of the `for` loop, showing values of `f`, then `fr`, then `fre`, and so on.
231
231
@@ -243,9 +243,14 @@ Features that allow you to inspect variables are one of the most useful features
243
243
244
244
1. Expand the `letters` variable to show the elements that it contains.
245
245
246
-

246
+
::: moniker range=">= vs-2022"
247
+

248
+
::: moniker-end
249
+
::: moniker range="vs-2019"
250
+

251
+
::: moniker-end
247
252
248
-
The **Locals** window shows you the variables that are in the current [scope](https://www.wikipedia.org/wiki/Scope_(computer_science)), that is, the current execution context.
253
+
The **Locals** window shows you the variables that are in the current [scope](https://www.wikipedia.org/wiki/Scope_(computer_science)), that is, the current execution context.
249
254
250
255
## Set a watch
251
256
@@ -263,7 +268,12 @@ Features that allow you to inspect variables are one of the most useful features
263
268
264
269
2. Click **F11** a few times until you see the debugger pause in the `SendMessage` method. Look at the **Call Stack** window.
265
270
266
-

271
+
::: moniker range=">= vs-2022"
272
+

273
+
::: moniker-end
274
+
::: moniker range="vs-2019"
275
+

276
+
::: moniker-end
267
277
268
278
The **Call Stack** window shows the order in which methods and functions are getting called. The top line shows the current function (the `SendMessage` method in this app). The second line shows that `SendMessage` was called from the `main` method, and so on.
0 commit comments