为什么取消引用指针称为取消引用?

发布于 2024-09-03 13:25:37 字数 173 浏览 5 评论 0原文

为什么取消引用称为取消引用?

我只是在正确地学习指针,我想知道为什么取消引用被称为这样。这让我很困惑,因为听起来您正在删除引用,而不是通过指向目的地的指针。

谁能解释一下为什么这么叫?

对我来说,诸如“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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

那小子欠揍 2024-09-10 13:25:38

指针引用一个对象。因此,我们解引用指针(或者,获取指针的所指对象)来获取指向的对象。

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."

怪我闹别瞎闹 2024-09-10 13:25:38

取消引用意味着取消引用并给出它实际引用的内容。

指向某物的指针实际上意味着您的指针变量保存某物的内存地址。但指针也可以被认为是对某物的引用。

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 of something. But the pointer can also be thought of as a reference to something instead.

掩耳倾听 2024-09-10 13:25:38

维基词典仅包含与编程相关的定义: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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文