I'm confused.
From what I've been reading a namespace allows me to use a name belonging to that same namespace. But only if I have that name already declared. Usually by means of an include statement.
This gives rise to 2 questions:
1. Why then I want the using directive? The simple fact I included the header say, stdlib, already allows me to access it's declarations without any kind of qualification.
2. With my compiler (below), I gained the habit of not including stdlib, but instead using namespace std;. This still allows me to access functions like system() without any qualification. But it clearly goes against what i have been reading now about namespaces.
So, can someone please help me understand exactly what is a namespace and how does it affect && is affected by an include? Take it like I'm 5 years old, will ya![]()



LinkBack URL
About LinkBacks



