A namespace is pretty much a set of names that have been declared in the program at some point. It's a container and every library is only supposed to declare things in its own namespace. I guess for orginazation. "std" is the standard library namespace.
So, if you wanted to use 'cout' of the std namespace, you do:
Code:
using namespace std;
cout << "blah" << endl;
OR
Code:
std::cout << "blah" << endl;
The difference is that when you have 'using namespace std;', it puts you in that namespace so that functions you call are checked from there and you don't have to prefix them with std::.
You can declare your own namespaces, as so:
Code:
namespace MyNewNameSpace {
void function();
int variable;
};
Hope this helps.