This section contains information you should review before using this book and instructions to ensure that your computer is set up properly to compile the example programs.
We use fonts to distinguish between features, such as menu names, menu items, and other elements that appear in your IDE (Integrated Development Environment), such as Microsoft’s Visual Studio. Our convention is to emphasize IDE features in a sans-serif bold Helvetica font (for example, File menu) and to emphasize program text in a sans-serif Lucida
font (for example, bool x = true;
).
Before reading this book, you should download and install a C++ compiler. We wrote C++ How to Program, 10/e’s code examples using the following free C++ development tools:
Microsoft’s free Visual Studio Community 2015 edition, which includes the Visual C++ compiler and other Microsoft development tools. This runs on Windows and is available for download at
https://www.visualstudio.com/products/visual-studio-community-vs
GNU’s free GNU C++ 5.2.1 compiler. GNU C++ is already installed on most Linux systems and also can be installed on Mac OS X and Windows systems. There are many versions of Linux, known as Linux distributions, that use different techniques for performing software upgrades. Check your distribution’s online documentation for information on how to upgrade GNU C++ to the latest version. GNU C++ is available at
http://gcc.gnu.org/install/binaries.html
Apple’s free Xcode, which OS X users can download from the Mac App Store— click the app’s icon in the dock at the bottom of your Mac screen, then search for Xcode in the app store.
We also provide links to our getting-started videos for each of these C++ tools at:
http://www.deitel.com/books/cpphtp10
The examples for C++ How to Program, 10/e are available for download at
http://www.deitel.com/books/cpphtp10
Click the Download Code Examples link to download the ZIP archive file to your computer. Write down the location where you saved the file—most browsers will save the file into your user account’s Downloads
folder.
Throughout the book, steps that require you to access our example code on your computer assume that you’ve extracted the examples from the ZIP file and placed them in C:examples
on Windows or in your user account’s Documents
directory on other platforms. You can extract them anywhere you like, but if you choose a different location, you’ll need to update our steps accordingly.
In Section 1.10, we demonstrate how to compile and run programs with
Microsoft Visual Studio Community 2015 edition on Windows (Section 1.10.1)
GNU C++ 5.2.1 on Linux (Section 1.10.2)
Apple Xcode on OS X (Section 1.10.3)
For GNU C++ and Xcode, you must compile your programs with C++14. To do so in GNU C++, include the option -std=c++14
when you compile your code, as in:
g++ -std=c++14 YourFileName.cpp
For Xcode, after following Section 1.10.3’s steps to create a project:
Select the root node at the top of the Xcode Project navigator.
Click the Build Settings tab in the Editors area.
Scroll down to the Apple LLVM 7.0 - Language - C++ section.
For the C++ Language Dialect option, select C++14 [–std=c++14].
As you read the book, if you have questions, we’re easy to reach at
[email protected]
We’ll respond promptly.
In addition, the web is loaded with programming information. An invaluable resource for nonprogrammers and programmers alike is the website
http://stackoverflow.com
on which you can:
Search for answers to most common programming questions
Search for error messages to see what causes them
Ask programming questions to get answers from programmers worldwide
Gain valuable insights about programming in general
For documentation on the C++ Standard Library, visit
http://cppreference.com
and be sure to check out the C++ FAQ at
https://isocpp.org/faq