How do I flush the cin buffer?

前端 未结 13 1075
無奈伤痛
無奈伤痛 2020-11-22 00:14

How do I clear the cin buffer in C++?

相关标签:
13条回答
  • 2020-11-22 00:42

    It worked for me. I have used for loop with getline().

    cin.ignore()
    
    0 讨论(0)
提交回复
热议问题