I'm confused. I wrote a function called hash() and I'm using namespace std for cout,endl and laziness.
Error reference to 'hash' is ambiguous
I know now that a hash function exist in std::
So my question is why the compiler throws this error because I did never include functional.h?
Is there an index anywhere of names from std:: so that I can avoid these names in future when I'm writing my own functions, I can't find anything with google?
I'm confused because of when "everything" is known in std:: why is needed to include the headers? I'm sure that I'm missing something
Maybe my title is not the best but I don't know better.
#include <iostream>
using namespace std;
const int SIZE_TABLE = 10;
int hash(int x)
{
return x%SIZE_TABLE;
}
int main()
{
cout<<"hash 24 "<<hash(24)<<endl;
return 0;
}