Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the name of the "<<" and ">>" operators? [duplicate]

Tags:

c++

symbols

I'm wondering if there is a standard name for the "<<" and ">>" operators? This is mostly in the context of teaching C++ and using those operators as part of stream input/output. If I need to read code or prompt for student responses (such as cout << "Hello";), I'm not sure how to verbalize those symbols. Is there a convention when reading them out loud?

Improved version of this question: How do you read the "<<" and ">>" symbols out loud?

like image 397
Daniel R. Collins Avatar asked Mar 11 '17 03:03

Daniel R. Collins


People also ask

What are << and >> called in C++?

This operator (<<) applied to an output stream is known as insertion operator.

What is the name of >> operator?

“>>” is extraction operator because “it extract data enter by user from console or input screen to some storage location identified by variable”.


1 Answers

When not overloaded, left-shift and right-shift and some people call them that even when used with streams, but insertion and extraction is a lot more common in that context. They are also sometimes informally called put to and get from. IIRC, Stroustrup favoured that last form.

like image 114
Jon Hanna Avatar answered Sep 30 '22 06:09

Jon Hanna