+ 1
I am confused
So you see this piece of code which absolutely works perfectly with no errors? It shows a weird behaviour on the compiler on my PC ! hi is pretend as 26729! Any string in the if statement's body is parented in numbers! https://sololearn.com/compiler-playground/cRhlup6vOKOl/?ref=app The code was a successful attempt to detect when user leaves input empty. But showed unexpected behaviour.
3 Respuestas
+ 3
Jayakrishna 🇮🇳 , yea it does work here, but doesn't on my pc which is why I am very confused.
+ 1
It works fine.
+ 1
Intermediate Depression Strange.
May be you are using old compilers which doesn't terminate on no input or will repeat loop with last input repeatedly.. Or takes garbage.. not updated work with getline() method.. A guess, not sure.
Point is "Code is fine for the expected task"..