0
I need to read a string considering the spaces in c++. Type like this:
string frase;
std::cin >> frase;
It seems trite, but I can’t seem to solve it. Grateful, from now on.
0
I need to read a string considering the spaces in c++. Type like this:
string frase;
std::cin >> frase;
It seems trite, but I can’t seem to solve it. Grateful, from now on.
3
You, can use the getline function(), getline(cin, frase);
, will consider the spaces it will stop reading until it breaks a line.
You can have a look at the documentation : http://www.cplusplus.com/reference/string/string/getline/
Thank you very much! It worked here.
Browser other questions tagged c++
You are not signed in. Login or sign up in order to post.
Does this help you? https://answall.com/questions/255847/como-ler-uma-string-com-espa%C3%A7o-em-c-dentro-de-uma-fun%C3%A7%C3%A3o
– Luiz Augusto