Part Four - Building A Visual Studio C++ Project

Nested C++ Recursion - Introduction (Main Article Page)

Part Three - Euler 44 Solution Groundwork described, in a very general way, the solutions we'll examine in this article. In Part Four - Building A Visual Studio C++ Project here, we'll see how to build a Visual Studio solution with the sample files available at the GitHub resource, and we'll learn how to shortcut the steps common to all of those solutions.

In the GitHub resource, the solutions can have two or three CPP files, combined with two or three .h (header) files. We'll see how to build a finished Visual Studio solution with a two-CPP file, two-.h file solution. The approach extends to the other available solutions.

This GitHub resource

shows the component files we'll use to build a finished example C++ solution in Visual Studio. First, launch Visual Studio, and drill down to create a new project:

In the New Project pane, use these values

   - Visual C++ -> Win32 (project type)
   - Win32 Console Application
   - Euler_44 (project name)

to start the project creation process. Click OK at the bottom right to continue. In the next pane
click Finish. Visual Studio will look like this:
Copy the code from the files in the GitHub resource seen in the first image on this page into the matching files seen in the Solution Explorer of the image just above. For each code file, click Raw as shown here
to open a view
with the raw code.

If we drill down to

          Debug -> Start Debugging

the software will crash, because of a stack overflow:
We'll see how to fix this, for all the solutions described in this article, in Part Five - Stack Configuration.