namespaces are useful if you make a function library. Their purpose is to reduce name clashes. Also it helps a human reader understand what a function or variable is for if they are grouped together under a common name. i.e all graphics functions could be grouped under a gfx namespace...
Code:
namespace gfx {
void Initialize();
void Render();
void Shutdown;
}
Instead of
Code:
void gfx_Initialize();
void gfx_Render();
void gfx_Shutdown();
Of course you wouldn't make the gfx scope globle because Initialize, Shutdown and Render are popular names for functions. So you would use the scope operator.
When calling a function.
Namespaces are open, i.e.
Code:
namespace bob {
int x, y;
}
namespace bob {
std::string name;
}
namespace bob {
int age;
}
You can keep adding names whenever you want.