How to run one C++ program when multiple files are in one project:

How to Remove

When you want to compile one program but you have multiple files in the project, you need to exclude the files you don't want in the project. For example, if you have hello.cpp and lab5.cpp in one project, and you want to compile hello.cpp, you need to exclude lab5.cpp. To do this, right click on lab5.cpp under the solution explorer, choose Exclude from Project. See the following image.

How to Add

When you want to add another C++ program in the project again, here is what to do.