std::getline does not work inside a for-loop

后端 未结 9 2207
醉话见心
醉话见心 2020-12-15 10:28

I\'m trying to collect user\'s input in a string variable that accepts whitespaces for a specified amount of time.

Since the usual cin >> str does

9条回答
  •  长情又很酷
    2020-12-15 10:44

    Are you hitting enter? If not get line will return nothing, as it is waiting for end of line...

提交回复
热议问题