Advertisement
Guest User

Untitled

a guest
Aug 16th, 2017
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include <string>
  4. using namespace std;
  5. using std::cerr;
  6. #include <cstdlib> // for exit function
  7. #include "HashTable.h"
  8.  
  9. void main ()
  10. {
  11. HashTable<string> ht (118619);
  12. string STRING;
  13. ifstream infile;
  14. infile.open ("dictionary.txt");
  15. if(!infile) { // file couldn't be opened
  16. cerr << "Error: file could not be opened" << endl;
  17. exit(1);
  18. }
  19.  
  20. while(!infile.eof()) // To get you all the lines.
  21. {
  22. getline(infile,STRING); // Saves the line in STRING.
  23. hash;
  24. cout<<STRING; // Prints our STRING.
  25. }
  26.  
  27. infile.close();
  28. system ("pause");
  29.  
  30. infile.open ("document.txt");
  31. if(!infile) { // file couldn't be opened
  32. cerr << "Error: file could not be opened" << endl;
  33. exit(1);
  34. }
  35.  
  36. while(!infile.eof()) // To get you all the lines.
  37. {
  38. getline(infile,STRING); // Saves the line in STRING.
  39.  
  40. cout<<STRING; // Prints our STRING.
  41. }
  42.  
  43. infile.close();
  44. system ("pause");
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement