This is my first question on StackOverflow and I would really appreciate any help I can get.
I have a file with a German word and its English translation separated by a semicolon in each line.
It looks something like this:
Hund;dog
Katze;cat
Pferd;horse
Esel;donkey
Fisch;fish
Vogel;bird
I have created the following structure:
struct Entry
{
string english = "empty";
string german = "empty" ;
};
What am trying to do is to create a function that would copy the first word of each line to the string german
and then skip the semicolon and copy the second word in the line to the string english
and this should be done line by line into an array of the variable type Entry
.
This the function I created - of course it's missing a few lines that would do the actual copying. :)
void importFile(string fname, Entry db[])
{
ifstream inFile;
inFile.open(fname);
}
Thanks in advance.