• 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
Question
2 Votes
Hi guys I need some one to teach the String name how I can do it true because when I finish coding they give me NO OUTPUT
2 Votes
Wayss
0 Votes
generic programming understanding memory ownership
0 Votes
fully dynamic arrays
1 Votes
I dont now that how to do js
2 Votes
Project subjection
0 Votes
How to start in web dev?
0 Votes
Wishkit alternative for android
1 Votes
Hi
0 Votes