C
C#13h ago
fraantic

How can I check if an index of a 2d array is out of bounds?

tittle
if (array[value1][value2] == outOfBounds) {
// do smth
}
if (array[value1][value2] == outOfBounds) {
// do smth
}
2 Replies
Keswiik
Keswiik13h ago
check the length of each array compared to the indexes you are attempting to access
fraantic
fraanticOP13h ago
ok
Want results from more Discord servers?
Add your server