Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I know the names of most of the operators but not sure what operator<< and operator>> are called.

i.e.

operator=() // the assignment operator
operator==() // the equality of comparison operator
operator++() // the increment operator
operator--() // decrement operator etc.
operator<() // the less-than operator

and so forth...

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
172 views
Welcome To Ask or Share your Answers For Others

1 Answer

<< is both the insertion operator and the left-shift operator.
>> is the extraction operator and the right-shift operator.

In the context of iostreams, they are considered to be stream insertion/extraction. In the context of bit-shifting, they are left-shift and right-shift.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...