0
Can someone explain what the << in C++ exactly does?
Why does there need to be a << after cout? For example when I write cout << "Hello" or << endl Why can't I just write endl; without the << before it?
2 Respostas
+ 3
It is the insertion operator. It is use to pass arguments into the ostream cout object in this case. In other cases << is a bit shift operator, so don't be confused by its use there.
http://www.cplusplus.com/reference/ostream/ostream/operator%3C%3C/
+ 1
Thank you!