Guest User

Untitled

a guest
Jun 25th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.64 KB | None | 0 0
  1. #include <iostream>
  2. #include "wordcounter.h"
  3. #include <string>
  4. #include <fstream>
  5. const int MAXCHAR=80;
  6. using namespace std;
  7.  
  8. int main()
  9. {
  10.     char Filename[MAXCHAR];
  11.     string TheBird;
  12.  
  13.     ifstream MyInputFile;
  14.     cout << "Input file: ";
  15.     cin >> Filename;
  16.     MyInputFile.open(Filename);
  17.     while(!MyInputFile.is_open())
  18.     {
  19.         cout << "\nTry Again: ";
  20.         cin >> Filename;
  21.         MyInputFile.open(Filename);
  22.     }
  23.  
  24.     MyInputFile >> TheBird;
  25.  
  26.     while(!MyInputFile.eof() )
  27.     {
  28.         cout << "Read in the word: " << TheBird << endl;
  29.         MyInputFile >> TheBird;
  30.     }
  31.     MyInputFile.close();
  32.    
  33.     WordCounter(file);
  34.     file.Addword(TheBird);
  35.     file.Printsummary();
  36. }
Add Comment
Please, Sign In to add comment