“<<"的名字是什么?和“&gt;&gt;"运营商? [英] What is the name of the &quot;&lt;&lt;&quot; and &quot;&gt;&gt;&quot; operators?

查看:36
本文介绍了“<<"的名字是什么?和“&gt;&gt;"运营商?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道<<"是否有标准名称?和>>"运营商?这主要是在教授 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-shiftright-shift 甚至有人称它们为与流一起使用,但 insertionextraction 在这种情况下更常见.它们有时也被非正式地称为put toget 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.

这篇关于“<<"的名字是什么?和“&gt;&gt;"运营商?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆