Name: Anonymous 2018-01-28 5:28
.
list<string> readWordFile(char * filename) {
list<string> wordList;
ifstream wordFile (filename, ios: : in);
if (wordFile = = NULL) {
cout << "File open failed. \n";
return wordList;
}
char currentWord[30];
while (wordFile >> currentWord) {
if (strchr(currentWord, '\ '') ==0) {
string temp(currentWord);
wordList.push_back(temp);
}
}
return wordList;
}