Using C++ language features
Let's now use the features you have learned in this chapter to write an application. This example is a simple command-line calculator; you type an expression such as 6 * 7, and the application parses the input and performs the calculation.
Start Visual C++ and click the File
menu, and then New
, and finally, click on the File...
option to get the New File
dialog. In the left-hand pane, click on Visual C++
, and in the middle pane, click on C++ File (.cpp),
and then click on the Open
button. Before you do anything else, save this file. Using a Visual C++ console (a command line, which has the Visual C++ environment), navigate to the Beginning_C++
folder you created in the previous chapter and create a new folder called Chapter_02
. Now, in Visual C++, on the File
menu, click Save Source1.cpp As...
and in the Save File As
dialog locate the Chapter_02
folder you just created. In the File name
box, type calc.cpp
and click on the Save
button.
The application will use std...