• 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
App Development
1 Votes
GUI-Based Python code in Webpage
3 Votes
I'm still new, help me about my image code
0 Votes
Convert Animated SVG to PNG
1 Votes
My Missing Courses
1 Votes
What will be the output of this code?
1 Votes
Are '\0' and NULL the same?
1 Votes
Number addition
0 Votes
cyber security
0 Votes
my code isn’t working can someone give me tips?
1 Votes