what does it mean to namespace code example

Example 1: whar is namespace

We can think of namespace as you made a private space for your variables or 
functions so that ther cann't be any condition where you can find name 
collision of variable or function a program.
I found out a great article on tutorialspoint and would definitely suggest you 
all to go there to have a better understanding of namespaces.
https://www.tutorialspoint.com/cplusplus/cpp_namespaces.htm

Example 2: namespace

#include <iostream>

using namespace std;

namespace {
int x;
void display();
}

namespace{
void display(){
cout << "x is "<<x<<endl;
}
}

int main()
{
    x = 25;
    display();
    return 0;
}

Tags:

Cpp Example