< Previous | Contents | Next >
The program starts in the same way. I use two opening comments and then include iostream for output. But next, I have a new type of statement.
using namespace std;
This using directive gives me direct access to elements of the std namespace. Again, if a namespace is like an area code, then this line says that all of the elements in the std namespace should be like local phone numbers to me now. That is, I don’t have to use their area code (the std:: prefix) to access them.
I can use cout and endl, without any kind of prefix. This might not seem like a big deal to you now, but when you have dozens or even hundreds of references to these objects, you’ll thank me.