Partial list of words pulled and printed from file
Closed this issue · 2 comments
Task: Pull list of words from a file and put into a vector.
Issue: Prints partial list. Only words starting at trickyWordsVector[10];
Fix: Print entire list.
Still a bug. Tricky word list caps at ~300 lines and stops printing all of the words. But, this may not be an issue because the words will be printed in sets. Need to check if all of each set will be printed if the file's lines > 300.
Found solution using https://stackoverflow.com/questions/22127149/finding-words-with-the-same-first-character!
Partial code:
char letterCharSwitch; // character tied to first letter of each word
void printWords(){
for (int i = 0; i < trickyWordsVector.size(); i++) {
if(trickyWordsVector[i][0] == letterCharSwitch){
cout << trickyWordsVector[i];
cout << "\n";
}
}
}