I'm trying to use a while loop to read in some files, but it only reads once and quits. Not sure what's wrong, professor says this is how it should work as long as I'm understanding him correctly.
void populateStruct(ifstream &filein, WordStruct Words[1000], int &itemamount)
{
while (filein >> Words[itemamount].Word);
{
Words[itemamount].WordAmt = 1;
itemamount++;
cout << itemamount;
}
return;
}
I've tried placing the filein >> command inside the loop as well as it being the condition, but nothing.