C++ iostream: Using cin >> var and getline(cin, var) input errors

前端 未结 5 1039
旧时难觅i
旧时难觅i 2020-12-06 23:11

I\'m creating a simple console application in C++ that gets string and char inputs from the user. To make things simple, I would like to use the string and

5条回答
  •  爱一瞬间的悲伤
    2020-12-06 23:19

    ignore() does not skip a line, it skips a character. Could you send example code and elaborate on the need for cin.ignore()?

提交回复
热议问题