Based on the example bellow, am I getting a grasp of namespace correctly as a means to group related things together, or should namespace in C++ be used in different situations/usage purposes.
C++:
#include <iostream>
using std::cout;
namespace English
{
void Hello()
{
cout << "Hello! " << "\n";
}
void Description()
{
cout << "An english speaking person. " << "\n";
}
}
namespace Spanish
{
void Hello()
{
cout << "Hola! " << "\n";
}
void Description()
{
cout << "A spanish speaking person. " << "\n";
}
}
namespace Trumpish
{
void Hello()
{
cout << "Go back to where you came from illegal! " << "\n";
}
void Description()
{
cout << "White person carrying a gun and a red cap that reads \n"
<< "MAKE AMERICA GREAT AGAIN. " << "\n";
}
}
int main()
{
English::Hello();
English::Description();
Spanish::Hello();
Spanish::Description();
Trumpish::Hello();
Trumpish::Description();
}