C
C#2mo 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
Keswiik2mo ago
check the length of each array compared to the indexes you are attempting to access
fraantic
fraanticOP2mo ago
ok

Did you find this page helpful?