+ 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

6th Sep 2017, 2:43 PM
RZK 022
RZK 022 - avatar
7 Réponses
+ 8
I got No Output. Then added one more < then it was fine.
6th Sep 2017, 3:05 PM
Manual
Manual - avatar
+ 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 >.<
6th Sep 2017, 3:56 PM
Yanothai Chaitawat
Yanothai Chaitawat - avatar
+ 4
..... And Why don't mention or like to @Liam?
7th Sep 2017, 12:31 PM
Yanothai Chaitawat
Yanothai Chaitawat - avatar
+ 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 .
7th Sep 2017, 12:37 PM
RZK 022
RZK 022 - avatar
+ 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 .
7th Sep 2017, 12:26 PM
RZK 022
RZK 022 - avatar
+ 1
because the operator '<' means less than. so it wont throw any error.
7th Sep 2017, 10:22 AM
Liam Ashdown
Liam Ashdown - avatar