Put these main functions in separate namespaces and then determine which one you want to run, for example.
File1.cpp namespace F1 { int main(int argc, char * argv[]) {
Edit : in response to additional information.
C ++ is not Java, and VS is not Eclipse :) A natural way to simultaneously service several programs in VS is to place several projects (one for each executable file or library) in one solution. If you want to start a project, simply right-click on it in Solution Explorer , select Set as Startup Project , and then click the Start button to start it.
To add a project to the solution, right-click it and select Add | New project... or Add | Existing project .
Spook source share