A namespace declaration identifies and assigns a unique name to a user-declared namespace. Such namespaces are used to solve the problem of name collision in large programs and libraries. Programmers can use namespaces to develop new software components and libraries without causing naming conflicts with existing components.
For example:
//namespace X
{
int i;
double j;
}
int main()
{
X::i++;
}