Added a note for the example (#29878)
When I started learning programming for a good amount of time I couldn't understand why did we start the loop from 0 to print out values of an array, because I didn't know the "arrays are indexed from 0" rule back then. I thought this could be helpful
This commit is contained in:
committed by
Christopher McCormack
parent
430ec9d333
commit
0e92f98997
@ -42,6 +42,8 @@ int main () {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
- It should be noted that the value of `i` is set to `0` because arrays are indexed from `0` to `size-1`, and we want to print the first value as well
|
||||||
|
|
||||||
#### Output:
|
#### Output:
|
||||||
```shell
|
```shell
|
||||||
> Item on index 0 is 1
|
> Item on index 0 is 1
|
||||||
|
Reference in New Issue
Block a user