Advertisement
Guest User

main.cpp

a guest
Mar 21st, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.65 KB | None | 0 0
  1. #include "hash.h"
  2.  
  3. void countNames(HashTable &table, string path) {
  4.     ifstream text(path);
  5.     string name;
  6.     userInfo target;
  7.     while (getline(text,name)) {
  8.         table.hashFind(name,target);
  9.         target.count++;
  10.     }
  11. }
  12.  
  13. int main(){
  14.     setlocale(LC_ALL, "Russian");
  15.     string path;
  16.     cout << "Enter the path" << endl;
  17.     getline(cin,path);
  18.     int size;
  19.     cout << "Enter the size of the table" << endl;
  20.     cin >> size;
  21.     HashTable table(size);
  22.     table.form(path);
  23.     cout << "Forming is done"<<endl;
  24.  
  25.     cout << "Enter the path" << endl;
  26.     getline(cin,path);
  27.     countNames(table,path);
  28.  
  29.     table.print();
  30.     system("pause");
  31.     return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement