< Previous | Contents | Next >
Okay, there’s another way to accomplish what I did in Game Over 2.0: set up the file so that I don’t have to explicitly use the std:: prefix to access cout and endl. And that’s exactly what I’m going to show you in the Game Over 3.0 program, which displays the same text as its predecessors. You can download the code for this program from the Course Technology website (www.courseptr.com/down- loads). The program is in the Chapter 1 folder; the filename is game_over3.cpp.
// Game Over 3.0
// Demonstrates using declarations
12 Chapter 1 n Types, Variables, and Standard I/O: Lost Fortune
#include <iostream> using std::cout; using std::endl;
int main()
{
cout << "Game Over!" << endl; return 0;
}