<aside> <img src="/icons/home_green.svg" alt="/icons/home_green.svg" width="40px" />
</aside>
https://jennychen9827sbu.github.io/CAD281/array.html
Imagine a row of boxes. Each box stores a value. The whole row has one name — that’s an array. Each box also has a number label called an index so we can grab or update what's inside.
Let’s walk through this step by step.
int nums[4] = {10, 20, 30, 40};
This means:
nums.{10, 20, 30, 40} go into those boxes in order.So:
nums[0] → 10nums[1] → 20nums[2] → 30nums[3] → 40💡 In C, array indexing starts at 0, not 1.