程序员在代码中添加了断言来检查数组索引是否越界。

The programmer added an assertion to check if the array index is out of bounds.

点击显示答案

The programmer added an assertion to check if the array index is out of bounds.

assertion 来自动词 assert(断言、声称),加上名词后缀 -ion 构成。assert 本身由前缀 as-(表示"加强")和词根 sert("加入、连接")组成,原意是"坚决主张"。 在编程中,assertion 指"断言",是一种用于调试的声明语句,用来验证程序运行时的某个条件是否为真,如果条件不满足则会抛出错误。

在 App 中完整学习这张卡片

在 App 中学习