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 lab2.cpp in one project, and you want to compile
hello.cpp, you need to exclude lab2.cpp.
To do this, right click on lab2.cpp under the solution
Exclude from Project.
See the following image.
When you want to add another C++ program in the project again, here is what to do.