Namespace Aliases or Giving a New Name to an Exsting Namespace





This video tutorial explains about the namespace aliases in c++ programming.
You are gonna learn how to give a new name to an existing namespace, how to access the members of a namespace when it is given a new name , what is the use of namespace aliasing in detail with example.

source code for this tutorial

#include <iostream>

using namespace std;

namespace verylargenamespacename{
int x;
namespace nestednamespace{
void display(){
cout << x;
}
}
}

namespace one = verylargenamespacename;
namespace nested = one :: nestednamespace;
int main()
{
one ::x = 100;
nested :: display();
return 0;
}

 
Back To Top