你怎么读“<<"?和“>>"符号大声? [英] How do you read the "<<" and ">>" symbols out loud?

查看:42
本文介绍了你怎么读“<<"?和“>>"符号大声?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有一种标准的方式,如果我们大声朗读印刷符号,用于阅读 <<<>> 符号?当我教第一次 C++ 的学生并讨论/修复需要在特定位置编写哪些符号时,我就会想到这一点.

I'm wondering if there is a standard way, if we are pronouncing typographical symbols out loud, for reading the << and >> symbols? This comes up for me when teaching first-time C++ students and discussing/fixing exactly what symbols need to be written in particular places.

最好的答案不应该是诸如按位移位"或插入"之类的名称, 因为它们指的是更具体的 C++ 运算符,而不是上下文无关符号本身(这就是我们想要这里).从这个意义上说,这个问题与诸如this之类的问题相同.a> 或 this,其答案均不满足此问题.

The best answer should not be names such as "bitwise shift" or "insertion", because those refer to more specific C++ operators, as opposed to the context-free symbol itself (which is what we want here). In that sense, this question is not the same as questions such as this or this, none of whose answers satisfy this question.

一些比较示例:

  • 我们可以将 #include 读作磅包含括号 iostream括号".
  • 我们可以将int a, b, c;读作int a逗号b逗号c分号".
  • 我们可以将 if (a && b) c = 0; 读作if open parenthesis a 双与号 b close括号 c 等于零分号".
  • We can read #include <iostream> as "pound include bracket iostream bracket".
  • We can read int a, b, c; as "int a comma b comma c semicolon".
  • We can read if (a && b) c = 0; as "if open parenthesis a double ampersand b close parenthesis c equals zero semicolon".

所以一个等价的问题是:我们如何类似地阅读 cout <<你好";?目前在课堂上,我们将这些符号称为左箭头"和右箭头",但如果有更传统的措辞,我更愿意使用它.

So an equivalent question would be: How do we similarly read cout << "Hello";? At the current time in class we are referring to these symbols as "left arrow" and "right arrow", but if there is a more conventional phrasing I would prefer to use that.

陈述这个问题的其他等效方式:

Other equivalent ways of stating this question:

  • 我们如何排版阅读<<?
  • 符号<<一般名称是什么,无论是用于位移、插入还是重载以用于全新的事物?
  • 如果学生说:教授,我不记得如何制作插入运算符;请告诉我该输入什么符号",那么最好的口头回应是什么?
  • 填写这个类比的最佳方式是什么?对于乘法运算,我们使用星号;对于除法运算,我们使用正斜杠;对于插入运算,我们使用 ____."
  • How do we typographically read <<?
  • What is the general name of the symbol <<, whether being used for bit-shifts, insertion, or overloaded for something entirely new?
  • If a student said, "Professor, I don't remember how to make an insertion operator; please tell me what symbol to type", then what is the best verbal response?
  • What is the best way to fill in this analogy? "For the multiplication operation we use an asterisk; for the division operation we use a forward-slash; for the insertion operation we use ____."

推荐答案

通过 您对 Slashdot 的评论.我建议使用对符号已有共识的学生使用更简单的名称.与 + 被称为加号"和 - 被(通常)称为减号"一样,您可以通过以下方式调用 <用大于"或大于"命名小于"或小于"和 >.这会让人想起大多数学生很早就教过的数学运算和符号,他们应该很容易记住.另外,您可以在讨论比较运算符时使用相同的名称.所以,你会读

Saw this question through your comment on Slashdot. I suggest a simpler name for students that uses an already common understanding of the symbol. In the same way that + is called "plus" and - is (often) called "minus," you can call < by the name "less" or "less-than" and > by "greater" or "greater-than." This recalls math operations and symbols that are taught very early for most students and should be easy for them to remember. Plus, you can use the same name when discussing the comparison operators. So, you would read

std::cout << "Hello, world!" << std::endl;

作为

S T D 冒号冒号 C out 少双引号 Hello 逗号世界感叹号双引号少少 S T D 冒号冒号结束 L 分号.

S T D colon colon C out less less double-quote Hello comma world exclamation-point double-quote less less S T D colon colon end L semicolon.

还有,

#include <iostream>

作为

磅包括更少的 I O 流

pound include less I O stream greater

所以,对

教授,我不记得如何制作插入运算符;请告诉我该输入什么符号."

"Professor, I don't remember how to make an insertion operator; please tell me what symbol to type."

是更少".

更习惯的名称左/右尖括号"应该同时教,教更常见的名称,但少/大"很好地提醒了实际符号是什么,我认为.

The more customary name "left/right angle bracket" should be taught at the same time to teach the more common name, but "less/greater" is a good reminder of what the actual symbol is, I think.

Chevron 也是一个简洁的名字,但在我看来有点晦涩,更不用说公司隶属关系了.

Chevron is also a neat name, but a bit obscure in my opinion, not to mention the corporate affiliation.

这篇关于你怎么读“&lt;&lt;"?和“&gt;&gt;"符号大声?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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