Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <string>
- using namespace std;
- using std::cerr;
- #include <cstdlib> // for exit function
- #include "HashTable.h"
- void main ()
- {
- HashTable<string> ht (118619);
- string STRING;
- ifstream infile;
- infile.open ("dictionary.txt");
- if(!infile) { // file couldn't be opened
- cerr << "Error: file could not be opened" << endl;
- exit(1);
- }
- while(!infile.eof()) // To get you all the lines.
- {
- getline(infile,STRING); // Saves the line in STRING.
- hash;
- cout<<STRING; // Prints our STRING.
- }
- infile.close();
- system ("pause");
- infile.open ("document.txt");
- if(!infile) { // file couldn't be opened
- cerr << "Error: file could not be opened" << endl;
- exit(1);
- }
- while(!infile.eof()) // To get you all the lines.
- {
- getline(infile,STRING); // Saves the line in STRING.
- cout<<STRING; // Prints our STRING.
- }
- infile.close();
- system ("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement