fork(3) download
  1. #include <iostream>
  2. #include <functional>
  3.  
  4. int main()
  5. {
  6. std::string name ;
  7. std::cout << "name? " ;
  8. std::getline( std::cin, name ) ;
  9. std::hash<std::string> hash ;
  10. std::cout << "name: " << name << " hash code: " << hash(name) << '\n' ;
  11. }
  12.  
Success #stdin #stdout 0s 3032KB
stdin
Bjarne Stroustrup
stdout
name? name: Bjarne Stroustrup    hash code: 102305603