哪个数组元素是第一个?

发布于 2024-10-07 10:09:35 字数 1431 浏览 0 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(5

把昨日还给我 2024-10-14 10:09:35

我认为“first”这个词的英文含义是明确的,指的是一个序列。让“first”指的是初始元素的后继者是错误的。

如果可能会造成混淆,我会说“第三个元素,位于索引 2”。

I think the English meaning of the word "first" is unambiguous, and refers to the initial element of a sequence. Having "first" refer to the successor of the initial element is just wrong.

In cases where there might be confusion, I would say "the third element, at index 2".

情绪失控 2024-10-14 10:09:35

元素索引几乎依赖于语言(例如C:0,Lua:1),而第五个元素第五个元素,它只是可能的索引不同;)

我想这个答案太分散了......

The element index is pretty much language-dependent (e.g. C: 0, Lua: 1), whereas the fifth element is the fifth element, it's just the index that may be different ;)

I guess that's way too diffuse an answer...

寄意 2024-10-14 10:09:35

在某些语言中,例如 Pascal,您可以显式指定索引的范围。即

var stuff : array[-3..3] of integer;

stuff[-3] 仍然是数组中的第一个元素,而不是负的第三个元素。

In some languages, such as Pascal, you can specify the range of indexes explicitly. i.e.

var stuff : array[-3..3] of integer;

stuff[-3] is still the first element in the array, not the negative third.

挽手叙旧 2024-10-14 10:09:35

任何说“零”的人一定不会真正相信从零开始的索引。

Anyone saying 'zeroth' must not really believe in zero-based indexing.

久夏青 2024-10-14 10:09:35

第一个是第一个从堆栈中取出的。

The first is the one which is first taken from the stack.

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