New course! Every coder should learn Generative AI!
Try a free lesson0
If cin breaks on space meaning that it will return the first word. What should i use to enter whole string with many spaces?
2 Answers
+ 7
try
getline(cin,variable);
+ 7
Here is an example
https://code.sololearn.com/cp32oQ9205NP/?ref=app