Working with IDE (Visual Studio)
Part 1: To create a New Project
To create an empty console project:
- Menu item File - New - Project.
- In the Project Types section, find Visual C ++.
- In the Templates section, select Empty Project.
- Specify a name for the new "solution" (Solution Name) and a project name (Name).
- Save the project to a local drive in an easily accessible location (for example, D: \ Projects).
- It makes sense to uncheck the Create directory for solution checkbox so as not to duplicate directories unnecessarily.
Part 2: To Add files to your project
You can add new and existing source code files to a project (right-click on the project name in the Solution Explorer window => Add item => New item or Existing item if you have a file to add).
For any project, you will need at least one file with the entry point to the program - the main function.
Part 3: To Exclude files from your project
At first, it is convenient to create one project and add one file to it with the solution of each individual problem. However, this raises a problem: there is a main function in several files of the project, which is contrary to the rules of C ++.
To solve this problem, you need to "exclude" files from the project (right click on the file in the Solution Explorer window => Exclude from project). The files will disappear from the project window, but they will be saved in the project directory on disk - you can send them to the assignment page at the end of the lesson or after completing homework.