Skip to content
Go back

编程中常用符号的英文怎么读

Published:  at  03:00 PM

作为程序员,了解这些符号的英文名称和读法非常重要,尤其是在阅读英文文档或与国外同事交流时。

下面我将编程中最常用的符号分为几类,为你详细列出它们的名称(Name)英文读法(How to Read),并附上常见用法示例


1. 基础算术运算符 (Basic Arithmetic Operators)

符号 (Symbol)名称 (Name)英文读法 (How to Read)示例 (Example)
+Plus Signplusa + b (a plus b)
-Hyphen-Minusminusa - b (a minus b)
*Asteriskasterisk 或 timesa * b (a asterisk ba times b)
/Forward Slashslash 或 divided bya / b (a slash ba divided by b)
%Percent Signpercent 或 modulusa % b (a percent ba modulus b)
**Double Asteriskdouble asterisk 或 to the power ofa ** b (a to the power of b)

2. 赋值与复合赋值运算符 (Assignment Operators)

符号 (Symbol)名称 (Name)英文读法 (How to Read)示例 (Example)
=Equals Signequalsa = 5 (a equals 5a is assigned 5)
+=Plus Equalsplus equalsa += b (a plus equals ba is increased by b)
-=Minus Equalsminus equalsa -= b (a minus equals b)
*=Asterisk Equalsasterisk equalsa *= b (a asterisk equals b)
/=Slash Equalsslash equalsa /= b (a slash equals b)
%=Percent Equalspercent equalsa %= b (a percent equals b)

3. 比较运算符 (Comparison Operators)

符号 (Symbol)名称 (Name)英文读法 (How to Read)示例 (Example)
==Double Equalsdouble equals 或 equals equalsa == b (a equals b)
!=Exclamation Equalsnot equalsa != b (a not equals b)
<Less-Than Signless thana < b (a less than b)
>Greater-Than Signgreater thana > b (a greater than b)
<=Less-Than or Equalsless than or equal toa <= b (a less than or equal to b)
>=Greater-Than or Equalsgreater than or equal toa >= b (a greater than or equal to b)

4. 逻辑运算符 (Logical Operators)

符号 (Symbol)名称 (Name)英文读法 (How to Read)示例 (Example)
&&Double Ampersanddouble ampersand 或 ANDa && b (a AND b)
||Double Vertical Bardouble pipe 或 ORa || b (a OR b)
!Exclamation Markexclamation mark 或 NOT!a (NOT a)

5. 位运算符 (Bitwise Operators)

符号 (Symbol)名称 (Name)英文读法 (How to Read)示例 (Example)
&Ampersandampersand 或 bitwise ANDa & b (a bitwise AND b)
|Vertical Barpipe 或 bitwise ORa | b (a bitwise OR b)
^Caretcaret 或 bitwise XORa ^ b (a bitwise XOR b)
~Tildetilde 或 bitwise NOT~a (bitwise NOT a)
<<Double Less-Thandouble less-than 或 left shifta << 2 (a left shift 2)
>>Double Greater-Thandouble greater-than 或 right shifta >> 2 (a right shift 2)

6. 括号与分隔符 (Parentheses and Separators)

符号 (Symbol)名称 (Name)英文读法 (How to Read)示例 (Example)
()Parenthesesparentheses (singular: parenthesis)(a + b) (parentheses a plus b parentheses)
[]Square Bracketssquare bracketsarray[0] (array square bracket 0 square bracket)
{}Curly Bracescurly braces 或 braces{ ... } (open brace … close brace)
;Semicolonsemicolonint a; (int a semicolon)
,Commacommaa, b (a comma b)
.Period / Dotdotobject.method() (object dot method parentheses)
:Coloncolonkey: value (key colon value)
?Question Markquestion markcondition ? a : b ( ternary operator: condition ? a : b)
->Arrowarrowa -> b (a arrow b)

7. 其他特殊符号 (Other Special Symbols)

符号 (Symbol)名称 (Name)英文读法 (How to Read)示例 (Example)
#Hash / Octothorpehash 或 pound sign#include (hash include)
//Double Slashdouble slash// comment (double slash comment)
/* */Slash Starslash star … star slash/* comment */ (slash star comment star slash)
""Double Quotesdouble quotes"string" (double quotes string double quotes)
''Single Quotessingle quotes'c' (single quote c single quote)
\Backslashbackslash\n (backslash n)
_Underscoreunderscoremy_variable (my underscore variable)
@At Signat sign@decorator (at decorator)
$Dollar Signdollar sign$variable (dollar variable)
^Caretcaret(在正则表达式中) ^start (caret start)
*Asteriskasterisk(在正则表达式中) a* (a asterisk)
&Ampersandampersand(在 C/C++ 中) &var (address of var)
*Asteriskasterisk(在 C/C++ 中) *ptr (dereference ptr 或 pointer to ptr)

如何练习和记忆?

  1. 边写边说:在写代码时,尝试用英文默念出符号的名称,比如写 for (int i = 0; i < 10; i++) 时,可以默念:for parenthesis int i equals zero semicolon i less than ten semicolon i plus plus parenthesis
  2. 阅读英文文档:这是最自然的学习方式。当你看到 if (a !== b) 时,通过上下文你会知道它读作 if a is not equal to b
  3. 制作小抄:把你最不熟悉的符号写在一张纸上,放在手边,随时查看。


Previous Post
SQL Basic Syntax Study Notes
Next Post
regexp example