#include #include #include "StringUtils.h" using namespace std; const int MAX_WORDS = 1000; // test this with values 10, 213, 214, 215 const string FILE_NAME = "ocap.txt"; int main() { string dictionary[MAX_WORDS]; size_t dictionarySize = 0; string word; size_t i; ifstream file; file.open(FILE_NAME); if (!file) { cout << "Could not open " << FILE_NAME << endl; return 1; } file >> word; while (file and dictionarySize < MAX_WORDS) { dictionary[dictionarySize] = StripString(word); dictionarySize ++; file >> word; } if (file) { if (dictionarySize == MAX_WORDS) { cout << endl; cout << "There are more thant " << MAX_WORDS << " in the file. " << endl; cout << "Please increase MAX_WORDS in the program and recompile" << endl; cout << endl; } } file.close(); for(i=0; i