Files
kazoottt-blog/src/content/post/日记/2023/02/2023-02-21.md
2024-12-02 03:09:01 +00:00

1014 B
Raw Blame History

title, slug, date, author, tags, published, description, rinId, toAstro, category
title slug date author tags published description rinId toAstro category
2023-02-21 星期二 diary-2023-02-21 2023-02-21 KazooTTT
日记
true 在2023年2月21日的内容中讨论了数组元素索引为何从0开始编号的问题。根据地址计算公式索引实际上代表了内存地址的偏移量首个元素的地址偏移量为0因此索引从0开始是合理的。文章中还提供了一张图示进一步解释了这一概念。 23 false 日记-2023-02

2023-02-21 星期二

数组

4.1. 数组Array - Hello 算法 (hello-algo.com)
为什么数组元素索引从 0 开始编号?  根据地址计算公式,索引本质上表示的是内存地址偏移量,首个元素的地址偏移量是  0 那么索引是  0  也就很自然了。

Pasted image 20230221221853