GetUpperBound () e função GetLowerBound () para matriz
Alguém pode dizer o que as duas funções fazem? Eles tomam um argumento inteiro que é dito para ser dimensão. Mas como o valor desse inteiro muda a saída?
Abaixo está um exemplo que eu corri.
int[, ,] intMyArr = {{{ 7, 1, 3, 4 }, { 2, 9, 6, 5 } }, { { 7, 1, 3, 4 }, { 2, 9, 6, 5 }}};
Console.WriteLine(intMyArr.GetUpperBound(0)); // Output is 1
Console.WriteLine(intMyArr.GetUpperBound(1)); // Output is 1
Console.WriteLine(intMyArr.GetUpperBound(2)); // Output is 3
Console.WriteLine(intMyArr.GetLowerBound(0)); // Output is 0
Console.WriteLine(intMyArr.GetLowerBound(1)); // Output is 0
Console.WriteLine(intMyArr.GetLowerBound(2)); // Output is 0
Alguma idéia por que GetLowerBound () está sempre retornando 0? Se isso sempre retorna 0, então por que precisamos chamar esse método?