Vocabulary checker, problem
Hi,
I'm trying to create a program that tests you at some words in any language, but I've got problems.
When you shell type in words and translations, it jumps directly to the translation. Here's a bit of my code:
Code:
while (true)
{
cout << "Word: ";
getline(cin, words[i][0]); // it skips this
cout << endl;
cout << "Translation: ";
getline(cin, words[i][1]);
cout << endl << endl;
i++;
cout << "Enter some more words? [y|n]: ";
cin >> query;
if (query != 'y' && query != 'n')
{
cout << "Error..." << endl;
break;
}
else if (query == 'n')
{
break;
}
}
Thanks!