This site features a collection of common technical interview questions gathered by a group of programmers who have been through, and given, lots of technical interviews. There is an emphasis on C++ and game programming technical interviews, but most of the questions are relevant to any technical interview.
Namespaces

What is a ‘namespace’ and what is it used for? What is the purpose of the ‘using’ declaration?


1 Comment so far
Leave a comment

Namespace is used to avoid function name clashes between different libraries, it declares all function/variables within a scope which remains hidden otherwise until explictly mentioned which is done by the keywords ‘using’.

eg.

namespace myfuncs {
void func1();
int func2();

int fg;
}

..
..
..

in some file when you write …


using namespace myfuncs;



Leave a comment
If you are including code in your comment, place it within a <div class='code'></div> tag for better formatting.


Do you have a technical interview question you would like to submit? Some tips you would like to pass on? Just want to say hi? Feel free to contact us