+ 3
Something weird in c++
Hello guys , I was just writing a program in c++ and i discovered that if we write cout< instead of cout<< It doesn't give any error . Can you explain why is it happening ?? https://code.sololearn.com/cl0oazLeEGoN/?ref=app
7 Respuestas
+ 8
I got No Output.
Then added one more <
then it was fine.
+ 5
"Surely"
cout didn't overload < operator but overload <<
so < is just comparison operator
cout>"\n Hello World";
return true/false(1/0)
Mr:
cout << (cout>"\n Hello World");
It's kinda bad explaination bc I'm not good at both c++ and english >.<
+ 4
.....
And Why don't mention or like to @Liam?
+ 3
oh sorry it wasn't submitted due to this internet that is moving at the speed of sloth , but I want to say that the less than sign doesn't work in that way .
+ 2
@maual
Actually I am asking why it isn't showing any compilation error , I know that it doesn't give any output .
and @very hard , thanks for that explanation but it still doesn't explain most of the riddle .
+ 1
because the operator '<' means less than. so it wont throw any error.