int numWords; // total number of words read in from file
ifstream infile;
infile.open("words.txt");
int i = 0;
while (infile && i < maxSize) {
// read each word into wordlist until the end of file
//YOUR CODE HERE
}
numWords = i;

I found that by adding this line of code to the first //YOUR CODE HERE:

infile >> wordlist[i].original;
i++; I can select words from the word list via "cout << wordlist[PLACE IN THE LIST].original;"

I have no idea where wordlist[i].sorted comes into play.
This is due tomorrow and I've been agonizing over it!
Thanks!

MAJORdorMo

05-26-2009, 10:03 AM

I figured it out!!! I just started toying with the different things, and I started understanding how it all worked. It wasn't too hard. I think I was just scared because I never worked with structs before.
Here is the finalized code: