So I need to make a program that acts as a virtual dictionary. Whilst I don't want anyone to write my code for me, I'd appreciate some feedback on my code and maybe a point in the right direction to find some information on a problem im having.
Most of my program works fine, I'm having issues populating my vector from a .txt file and admittedly I dont really understand how it works.
Heres what I've been using:
ifstream myfile(filename);
if (myfile.is_open())
{
string Line;
string buffer;
string currentWordType = "none";
string currentWord = "none";
string currentWordDef = "none";
while (!myfile.eof())
getline(myfile, buffer);
currentWordType = buffer;
getline(myfile, buffer);
currentWord = buffer;
getline(myfile, buffer);
currentWordDef = buffer;
Word newWord(currentWordType, currentWord, currentWordDef);
wordList.push_back(newWord);
}
myfile.close();
Again I'm not exactly looking for someone to do this for me, just maybe point out some area's ive gone wrong and point me in the right direction.
Thanks!