K. Test Driving a C++ Program on OS X

In Section 1.10, we showed how to run and interact with a C++ application on Windows and Linux, respectively. Here, we introduce how to run and interact with the same C++ application on OS X. You’ll begin by running an entertaining guess-the-number game, which picks a number from 1 to 1000 and prompts you to guess it. If your guess is correct, the game ends. If your guess is not correct, the application indicates whether your guess is higher or lower than the correct number. There is no limit on the number of guesses you can make. [Note: For this test drive only, we’ve modified this application from the exercise in Chapter 6, Functions and an Introduction to Recursion. Normally this application randomly selects ...

Get C++ How to Program, Ninth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.