-secret message- Compiler doesn't take spaces when prompted for input | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 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 Respostas
+ 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