V2EX  ›  英汉词典
  •   指定的图片不存在

    Array Index Out of Bounds

    释义 Definition

    “array index out of bounds”指数组下标越界:程序试图访问数组中不存在的位置(例如数组长度为 5,却访问下标 5 或 -1),通常会导致运行时错误或异常(不同语言表现不同,如 Java 会抛异常,C/C++ 可能产生未定义行为)。

    发音 Pronunciation (IPA)

    /əˈreɪ ˈɪnˌdɛks aʊt əv baʊndz/

    例句 Examples

    The program crashed because of an array index out of bounds error.
    程序因为数组下标越界错误而崩溃了。

    When the loop condition used i <= length instead of i < length, it triggered an array index out of bounds exception during the last iteration.
    当循环条件把 i <= length 写成了 i < length 的反面时,最后一次迭代就会触发数组下标越界异常。

    词源 Etymology

    该表达由三部分组成:array(数组) + index(索引/下标) + out of bounds(超出边界)。其中 bounds 表示“界限、范围”,out of bounds 原本也常用于体育或一般语境中表示“出界、越界”,在编程里引申为“访问超出合法范围的数据位置”。

    相关词 Related Words

    文学与作品中的用例 Literary Works

    • Effective Java(Joshua Bloch):讨论数组与集合的边界检查、以及越界相关的异常与最佳实践。
    • Java Concurrency in Practice(Brian Goetz 等):在并发场景中涉及对共享数组/缓冲区的安全访问与边界问题。
    • Clean Code(Robert C. Martin):以示例与原则强调边界条件(包括数组边界)在代码质量与可靠性中的重要性。
    关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   2851 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 05:33 · PVG 13:33 · LAX 22:33 · JFK 01:33
    ♥ Do have faith in what you're doing.