• Courses
  • Code Compiler
  • Discuss
  • Pricing
  • Teams
Menu
+ 3
Use cin.ignore() after the last cin and before getline. The issue is that there is a character left in the stream which prevents reading the last string: https://stackoverflow.com/questions/12691316/getline-does-not-work-if-used-after-some-inputs#12691486
24th May 2022, 2:04 PM
Lisa
Lisa - avatar

Often have questions like this?

Learn more efficiently, for free:

  • Introduction to Python

    7.1M learners

  • Introduction to Java

    4.7M learners

  • Introduction to C

    1.5M learners

  • Introduction to HTML

    7.5M learners

See all courses
Hot today
Please tell me about methods
2 Votes
How do i learn php in here?
1 Votes
Hi everyone I hope you’re well
0 Votes
Running of python or js script (backend) and entering of html page by clicking SUBMIT button
2 Votes
Programming
0 Votes
Losing hearts
0 Votes
How can I unenroll from a course I chose by mistake?
0 Votes
Best app that teaches Photoshop step by step
0 Votes
Criar aplicativo
0 Votes