“<<"的名字是什么?和“>>"运营商? [英] What is the name of the "<<" and ">>" operators?
问题描述
我想知道<<"是否有标准名称?和>>"运营商?这主要是在教授 C++ 并将这些运算符用作流输入/输出的一部分的上下文中.如果我需要阅读代码或提示学生回答(例如 cout <<
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?
这个问题的改进版本:你如何阅读<<"和>>"符号大声说出来?
推荐答案
在没有过载的情况下,left-shift 和 right-shift 甚至有人称它们为与流一起使用,但 insertion 和 extraction 在这种情况下更常见.它们有时也被非正式地称为put to 和get from.IIRC,Stroustrup 赞成最后一种形式.
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.
这篇关于“<<"的名字是什么?和“>>"运营商?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!