Similar Posts

Subscribe
Notify of
3 Answers
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
CyborgBeta
1 year ago

The array funk has 23 seats (from 0 to 22).

x has the value 0 and z the value 1.

x develops like this:

0,2,4,6,8,usw.

At the same time, e.g.

1,3,5,7,9,etc.

This means that at the moment where x=22 applies, z=23 also applies. And access to the element with the index 23 is not permitted, an AIOOB reception is therefore triggered.

To prevent this, you could, for example, check x AND z in the grinding head.

KarlRanseierIII
1 year ago

Out of Bounds is an access outside the array.

You check x, but your z, with which you also access it, clearly exceeds the limit of the index.

jo135
1 year ago

Your array is only 23 entries. Thus, the highest index is 22. But you try to use index 23.