Why is cout printing twice when I use getline?

前端 未结 2 1054
青春惊慌失措
青春惊慌失措 2021-01-12 13:35

I\'m trying to read in a string of text using getline. For some reason, it prints \'Please enter your selection\' twice:

Please enter your selection
Please          


        
2条回答
  •  感动是毒
    2021-01-12 14:08

    I would use debugger (for example gdb in linux) to check why. Why make a theories when you can find out the real answer?

提交回复
热议问题