+ 1

-secret message- Compiler doesn't take spaces when prompted for input

https://code.sololearn.com/clY9f9ZBzdI4/?ref=app I cant seem to get the compiler to recognize spaces. For some reason when add in my own string and give no input, the program runs as intended. Any feedback would be amazing! :)

24th Jun 2022, 1:41 PM
kaizhou
kaizhou - avatar
2 Antworten
+ 6
cin reads only a word of input. Instead of it, use getline() or fgets() method. getline(cin, secretInput) ;
24th Jun 2022, 1:55 PM
Jayakrishna 🇮🇳
+ 1
Jayakrishna🇮🇳 Thank you so much, you're actually amazing!
24th Jun 2022, 2:01 PM
kaizhou
kaizhou - avatar