Use hash to calculate hash value - C++ STL

C++ examples for STL:unordered_set

Description

Use hash to calculate hash value

Demo Code

#include <iostream> 
#include <unordered_map> 

using namespace std; 

int main() /*from   w ww.j  a v a  2 s .  c  o  m*/
{ 
    hash<const char*> MyHash; 

    cout << "The hash of \"Hello World\" is:" << endl; 
    cout << MyHash("Hello World") << endl; 
    cout << "while the hash of \"Goodbye Cruel World\" is:" << endl; 
    cout << MyHash("Goodbye Cruel World") << endl; 

    return 0; 
}

Result


Related Tutorials