When you're within a namespace, you'll be using the function within this namespace, if you need the global function name, you'll have to use
::funct(). Here's an example with 3 different foo functions.
#include <iostream>
void foo()
{
std::cout << "Hello" << std::endl;
}
namespace exp
{
void foo()
{
std::cout << "eXpl0it3r says: Hello" << std::endl;
}
void bar()
{
foo();
}
void bar2()
{
::foo();
}
}
namespace hax
{
void foo()
{
std::cout << "Tank is hax!" << std::endl;
}
void bar()
{
foo();
exp::foo();
::foo();
}
}
int main()
{
foo();
exp::foo();
exp::bar();
exp::bar2();
hax::foo();
hax::bar();
std::cin.get();
}
Output:
Hello
eXpl0it3r says: Hello
eXpl0it3r says: Hello
Hello
Tank is hax!
Tank is hax!
eXpl0it3r says: Hello
Hello
If you still don't get it, then I might not understand, what you don't understand...