C++(dereference)取值符和(address-of)取址符的翻译说明
C++的两个术语翻译
操作符 | 英文 | 中文 | C++示例 | 中文翻译 |
---|---|---|---|---|
& | address-of operator | 取址符 | &var1 | 取址var1(var1是变量) |
* | dereference operator | 取址符 | *pi | 取值pi(pi是指针) |
(&)取址符
address-of operator (&),取址操作符,简称为取址符
英文原文:
Address-of operator (&)
The address of a variable can be obtained by preceding the name of a variable with an ampersand sign (&), known as address-of operator.
address-of operator (&)翻译为取址符
。
(*)取值符
dereference operator (*),取值操作符,简称为取值符
英文原文:
Dereference operator (*)
An interesting property of pointers is that they can be used to access the variable they point to directly. This is done by preceding the pointer name with the dereference operator (*). The operator itself can be read as “value pointed to by”.
其中的"value pointed to by",翻译为“某指针指向的值”,所以dereference operator (*)被译为取值符
较为直观,易于使用。
(&)取址符和(*)取值符的中文辨析
有人会说址
和值
的发音相近,会不会搞混?
通常不会混淆。址
和值
的拼音同是zhi
,但址
是3声调,值
是2声调,发音是完全不同的;进入到C++的编程坏境中,&
和*
是完全不同的两个操作,一个是对变量取其内存地址的操作,另外一个是对指针取其变量值的操作,看着代码,说的是取址
还是取值
操作,当事人完全明了,所以不存在混淆的问题。
(全文完)