Headers for namespace

Hello,

I have probably a very easy question, which is if it is necessary any header in oder to be able to use a namespace created by myself. For example:

namespace test
{
int a = 2;
int b = 5;
}

Should I add any header here? The thing is that I am using Visual Studio 2010. With it I do not need add any header to use namespace, but I think Visual Studio adds automatically many headers, so maybe it adds a header which is necessary when using namespace.

Thank you very much for your time.
The short answer is No, you don't need additional headers to define a namespace because it is just a C++ feature.

If you make use of functions/variables from other namespaces, however, you'll need to include the appropriate header files for those.
Hi webJose,

Thank you very much for your reply.

Regards, waso
Topic archived. No new replies allowed.