Because the language creators thought that this operator would be interesting to indicate "a piece of a stream". It was what visually gave some indication of being a stream, was available for this type of object and it seemed a good idea.
Note that only the cout
and cin
(in fact these guys are a cover on top of the real guys who manipulate the stream) have this operator help little, the types you use together need to have this operator also to be able to create the stream. The mechanism of stream is very complex and requires a lot of study.
The idea is that the result of this operator is always a formatted form of presentation of the object being used in stream, then the object provides the way it should appear, and need not be alone cout
or cin
, has several other possible ways of using this mechanism.
Although this seemed like a good idea at the time, 80’s, and in some cases still something useful, the mechanism proved problematic and limited, and in the most current version of the language is preferring a powerful data formatting mechanism, which I will not say is equal to that of C, because it’s so much better, but the way you remember it well. You can see more on documentation how to use it, will almost always be more interesting now and the stream will almost be a legacy.
Their correct names are stream Insertion Operator (<<) and stream Extraction Operator (>>), therefore even if the symbol is the same can not be confused with other existing operators, and that is one of the reasons that this is bad..