+ 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.

14th Dec 2023, 7:00 AM
Intermediate Depression
Intermediate Depression - avatar
3 Answers
+ 3
Jayakrishna šŸ‡®šŸ‡³ , yea it does work here, but doesn't on my pc which is why I am very confused.
14th Dec 2023, 4:12 PM
Intermediate Depression
Intermediate Depression - avatar
+ 1
It works fine.
14th Dec 2023, 3:00 PM
Jayakrishna šŸ‡®šŸ‡³
+ 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"..
14th Dec 2023, 5:08 PM
Jayakrishna šŸ‡®šŸ‡³