Skip to content

Commit 8c87d86

Browse files
Merge pull request #4824 from corob-msft/learn/corob/cpp-docs-4432
Update issues related to cpp-docs 4432
2 parents 5aaf3f1 + a76184f commit 8c87d86

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

docs/ide/walkthrough-working-with-projects-and-solutions-cpp.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: "Learn more about: Walkthrough: Working with Projects and Solutions (C++)"
33
title: "Walkthrough: Working with Projects and Solutions (C++)"
4-
ms.date: 10/27/2021
4+
ms.date: 02/23/2023
55
helpviewer_keywords: ["solutions [C++]", "projects [C++], about projects", "projects [C++]", "solutions [C++], about solutions"]
66
ms.assetid: 93a3f290-e294-46e3-876e-e3084d9ae833
77
---
@@ -19,7 +19,7 @@ It helps if you understand the fundamentals of the C++ language, and know what a
1919

2020
## Create a project
2121

22-
To create a project, first choose a project-type template. For each project type, Visual Studio sets compiler settings and—depending on the type—generates starter code that you can modify later. The following steps vary depending on which version of Visual Studio you are using. To see the documentation for your preferred version of Visual Studio, use the **Version** selector control. It's found at the top of the table of contents on this page.
22+
To create a project, first choose a project-type template. For each project type, Visual Studio sets compiler settings and—depending on the type—generates starter code that you can modify later. The following steps vary depending on which version of Visual Studio you're using. To see the documentation for your preferred version of Visual Studio, use the **Version** selector control. It's found at the top of the table of contents on this page.
2323

2424
::: moniker range=">=msvc-160"
2525

@@ -49,7 +49,7 @@ To create a project, first choose a project-type template. For each project type
4949

5050
1. In the left pane of the **New Project** dialog box, expand **Installed** and select **Visual C++**, if it isn't open already.
5151

52-
1. In the list of installed templates in the center pane, select **Windows Console Application**.
52+
1. In the list of installed templates in the center pane, select **Console App**.
5353

5454
1. Enter a name for the project in the **Name** box. For this example, enter *Game*.
5555

@@ -79,7 +79,11 @@ To create a project, first choose a project-type template. For each project type
7979

8080
When you create a project, Visual Studio puts the project in a solution. By default, the solution has the same name as the project. You can change the name in the **Solution name** box, but for this example, keep the default name.
8181

82-
1. Choose the **OK** button to create the project.
82+
1. Choose the **OK** button to dismiss the **New Project** dialog and start the **Win32 Application Wizard**.
83+
84+
1. In the wizard, choose the **Next** button. On the **Application Settings** page, under **Additional options**, clear the **Precompiled header** check box.
85+
86+
1. Choose the **Finish** button to create the project.
8387

8488
Visual Studio creates your new solution and project files, and opens the editor for the Game.cpp source code file it generated.
8589

@@ -99,7 +103,7 @@ This part of the walkthrough shows how to add a class to the project. When you a
99103

100104
1. In the **Add Class** dialog, enter *Cardgame* in the **Class Name** box. Don't modify the default file names and settings. Choose the **OK** button.
101105

102-
Visual Studio creates new files and adds them to your project. You can see them in the **Solution Explorer** window. The Cardgame.h and Cardgame.cpp files are opened in the editor.
106+
Visual Studio creates new files and adds them to your project. You can see them in the **Solution Explorer** window. Visual Studio opens the Cardgame.h and Cardgame.cpp files in the editor.
103107

104108
1. Edit the Cardgame.h file, and make these changes:
105109

@@ -120,12 +124,12 @@ This part of the walkthrough shows how to add a class to the project. When you a
120124
<!--[!code-cpp[NVC_Walkthrough_Working_With_Projects#101](../ide/codesnippet/CPP/walkthrough-working-with-projects-and-solutions-cpp_2.h)]-->
121125
`Cardgame(int players);`
122126

123-
- After the default destructor, add an inline declaration for a `static int` member function named *GetParticipants* that takes no parameters and returns the `totalParticipants` value.
127+
- After the default destructor, add an inline declaration for a `static int` member function named `GetParticipants` that takes no parameters and returns the `totalParticipants` value.
124128

125129
<!--[!code-cpp[NVC_Walkthrough_Working_With_Projects#102](../ide/codesnippet/CPP/walkthrough-working-with-projects-and-solutions-cpp_3.h)]-->
126130
`static int GetParticipants() { return totalParticipants; }`
127131

128-
The Cardgame.h file should resemble the code below after you change it:
132+
The Cardgame.h file should resemble this code after you change it:
129133

130134
<!--[!code-cpp[NVC_Walkthrough_Working_With_Projects#103](../ide/codesnippet/CPP/walkthrough-working-with-projects-and-solutions-cpp_4.h)]-->
131135

@@ -142,7 +146,7 @@ This part of the walkthrough shows how to add a class to the project. When you a
142146
};
143147
```
144148

145-
The line `#pragma once` tells the compiler to include the header file only one time. For more information, see [once](../preprocessor/once.md). For information about other C++ keywords in the header file above, see [class](../cpp/class-cpp.md), [int](../cpp/fundamental-types-cpp.md), [static](../cpp/storage-classes-cpp.md), and [public](../cpp/public-cpp.md).
149+
The line `#pragma once` tells the compiler to include the header file only one time. For more information, see [`once`](../preprocessor/once.md). For information about other C++ keywords in the header file, see [`class`](../cpp/class-cpp.md), [`int`](../cpp/fundamental-types-cpp.md), [`static`](../cpp/storage-classes-cpp.md), and [`public`](../cpp/public-cpp.md).
146150

147151
1. Choose the **Cardgame.cpp** tab at the top of the editing pane to open it for editing.
148152

@@ -151,7 +155,6 @@ This part of the walkthrough shows how to add a class to the project. When you a
151155
<!--[!code-cpp[NVC_Walkthrough_Working_With_Projects#111](../ide/codesnippet/CPP/walkthrough-working-with-projects-and-solutions-cpp_5.cpp)]-->
152156

153157
```cpp
154-
#include "pch.h" // remove this line in Visual Studio 2019
155158
#include "Cardgame.h"
156159
#include <iostream>
157160

@@ -164,7 +167,7 @@ This part of the walkthrough shows how to add a class to the project. When you a
164167
{
165168
totalParticipants += players;
166169
cout << players << " players have started a new game. There are now "
167-
<< totalParticipants << " players in total." << endl;
170+
<< totalParticipants << " players in total.\n";
168171
}
169172

170173
Cardgame::~Cardgame()
@@ -189,7 +192,6 @@ Add some code to your app that tests the new functions.
189192
// Game.cpp : Defines the entry point for the console application.
190193
//
191194

192-
#include "pch.h" // remove this line in Visual Studio 2019
193195
#include "Cardgame.h"
194196
#include <iostream>
195197

0 commit comments

Comments
 (0)