< Previous | Contents | Next >
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, I’m 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 doesn’t make local a bunch of other elements that I have no intention of using.