0
How do I get input from user in a vector string (with space counting).
4 Answers
+ 5
@Basant, kindly edit your question to include C++ in the question tag, @Calvin was right about tag purpose and usage.
Well, to allow a string with whitespace as input you can use:
getline(cin, <string_variable>);
Is this what you mean?
(Edit)
I forgot to close the parentheses, fixed now : )
Hth, cmiiw
+ 4
Relevant tags are required in Q&A Discussion, it helps you find solutions faster.
Please remove all tags, and add Cpp tag in this question.
+ 2
@Basant, can you provide a link to your code, let people see your code so they understand what is the problem and offer suggestion/solution : )
+ 2
In this code I have taken, input from user using cin, but this won't count a space (if there are spaces in between) so....
https://code.sololearn.com/c8FcPTvTjlh3/?ref=app