Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include "wordcounter.h"
- #include <string>
- #include <fstream>
- const int MAXCHAR=80;
- using namespace std;
- int main()
- {
- char Filename[MAXCHAR];
- string TheBird;
- ifstream MyInputFile;
- cout << "Input file: ";
- cin >> Filename;
- MyInputFile.open(Filename);
- while(!MyInputFile.is_open())
- {
- cout << "\nTry Again: ";
- cin >> Filename;
- MyInputFile.open(Filename);
- }
- MyInputFile >> TheBird;
- while(!MyInputFile.eof() )
- {
- cout << "Read in the word: " << TheBird << endl;
- MyInputFile >> TheBird;
- }
- MyInputFile.close();
- WordCounter(file);
- file.Addword(TheBird);
- file.Printsummary();
- }
Add Comment
Please, Sign In to add comment