为什么取消引用指针称为取消引用?
为什么取消引用称为取消引用?
我只是在正确地学习指针,我想知道为什么取消引用被称为这样。这让我很困惑,因为听起来您正在删除引用,而不是通过指向目的地的指针。
谁能解释一下为什么这么叫?
对我来说,诸如“destination”或“pointed_to_value”之类的东西更有意义。
Why is dereferencing called dereferencing?
I'm just learning pointers properly, and I'd like to know why dereferencing is called that. It confused me as it sounds like you are removing a reference, rather than going via the pointer to the destination.
Can anyone explain why it is called this?
To me something like destination or pointed_to_value would make more sense.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
指针引用一个对象。因此,我们解引用指针(或者,获取指针的所指对象)来获取指向的对象。
de- 前缀很可能来自拉丁语介词,意思是 from;我想您可以将取消引用视为“从引用获取引用对象(或对象)”。
A pointer refers to an object. Ergo, we dereference the pointer (or, get the referent of the pointer) to get the object pointed-to.
The de- prefix most likely comes from the Latin preposition meaning from; I suppose you could think of dereference as meaning "to obtain the referent (or object) from the reference."
取消引用意味着取消引用并给出它实际引用的内容。
指向
某物
的指针实际上意味着您的指针变量保存某物
的内存地址。但指针也可以被认为是对某物
的引用。Dereferencing means taking away the reference and giving you what it was actually referring to.
A pointer to
something
really means that your pointer variable holds a memory address ofsomething
. But the pointer can also be thought of as a reference tosomething
instead.维基词典仅包含与编程相关的定义:http://en.wiktionary.org/wiki/dereference
所以看起来这实际上只是技术术语。
Wiktionary only contains definitions related to programming: http://en.wiktionary.org/wiki/dereference
So it looks like it's really just technical jargon.