V2EX  ›  英汉词典
Enqueued related words: Dereference, Nullptr, Null Reference

Null Pointer

释义 Definition

空指针 / 零指针:在编程中,指一个指针变量不指向任何有效的内存对象,通常保存为特殊值(如 NULLnullptr)。对空指针进行解引用(访问其所指内容)常会导致程序崩溃或运行时错误。该术语也常出现在“空指针异常(null pointer exception)”等表达中。

发音 Pronunciation (IPA)

/ˈnʌl ˌpɔɪntər/

例句 Examples

The program crashed because it dereferenced a null pointer.
程序崩溃了,因为它对空指针进行了解引用。

To avoid security bugs, the function checks for a null pointer before copying data into the buffer.
为避免安全漏洞,该函数在把数据复制到缓冲区之前会先检查指针是否为空。

词源 Etymology

null 源自拉丁语 nullus,意为“没有、无”;pointer 来自 point(指向、指点)加上表示“做某事的人/物”的后缀 -er。合起来,“null pointer”字面意思是“指向‘无’的指针”,在计算机语境中引申为“不指向任何有效对象的指针”。

相关词 Related Words

文学与经典作品 Literary Works

  • The C Programming Language(Kernighan & Ritchie):讨论 NULL 指针与指针使用规范。
  • *Effective C++*(Scott Meyers):多处提到避免空指针解引用、改进接口设计等实践。
  • Java: The Complete Reference(Herbert Schildt):涉及 NullPointerException 与对象引用为 null 的常见错误。
  • Clean Code(Robert C. Martin):讨论用更清晰的设计减少 null 带来的复杂性与缺陷。
关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   3965 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 13ms · UTC 02:11 · PVG 10:11 · LAX 18:11 · JFK 21:11
♥ Do have faith in what you're doing.