< Previous | Contents | Next >

Employing using Declarations

In this version, I write two using declarations.

using std::cout; using std::endl;

By declaring exactly which elements from the std namespace I want local to my program, Im able to access them directly, just as in Game Over 2.0. Although it requires more typing than a using directive, the advantage of this technique is that it clearly spells out those elements I plan to use. Plus, it doesnt make local a bunch of other elements that I have no intention of using.