0

The below code skips the first getline prompt, but waits for the second prompt.

cout << "Enter a new animal in the form of a question," << endl << "e.g., 'Is it a whale?': " << endl;
getline(cin, first_question);
cout << "\nNow enter a question for which the answer is 'yes' for your new" << endl << "animal, and which does not contradict your previous answers: " << endl;
getline(cin, second_question);
KnightValor
  • 51
  • 1
  • 5
  • Thanks for the help. Not. – KnightValor Dec 04 '16 at 01:30
  • Is the problem on the first question or the second question? If the first, then the duplicate is probably relevant; your previous input left the newline in the input stream read for `getline()` to return without needing further interaction from the user. If it is the second question, then there is more thinking to be done. Since your question doesn't identify how the problem manifests itself, and it certainly isn't an MCVE ([MCVE]), not least because it doesn't show the input and expected vs actual output, the duplicate closure is reasonable. – Jonathan Leffler Dec 04 '16 at 01:36

0 Answers0