using, namespace, and std
The next line, using namespace std;, will be present in nearly all of our programs. It tells the compiler to treat the names in the standard library, a very important part of the C++ language definition, as though we had defined them in the current program. These names from the standard library include string, which is why we need using namespace std; here. I'll go into this in much more detail later, but in the meantime, here's a little information about using, namespace, and std.
A namespace is a collection of identifiers (variable names and some other types of names that we haven't discussed yet) that all belong to a “family” of sorts. To refer to a specific identifier that belongs to a namespace, you can prefix the ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access