Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is "operator<<" called?

Tags:

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...

like image 922
ScaryAardvark Avatar asked Jul 19 '10 13:07

ScaryAardvark


People also ask

Why << is called insertion operator?

The insertion ( << ) operator, which is preprogrammed for all standard C++ data types, sends bytes to an output stream object. Insertion operators work with predefined "manipulators," which are elements that change the default format of integer arguments.

What do we call << in C++?

The symbol << is called insertion operation and output operator.


1 Answers

<< 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.

like image 177
Scott Stafford Avatar answered Oct 09 '22 08:10

Scott Stafford