Following situation: I have a Array which got 2 dimension. No i want to access the second dimension. How can i achieve this goal?
Here my code to clarify my problem:
private static int[,] _Spielfeld = new int[_Hoehe, _Breite];
private static bool IstGewonnen(int spieler)
{
bool istGewonnen = false;
for (int zaehler = 0; zaehler < _Spielfeld.GetLength(0); zaehler++)
{
//Here i cant understand why compiler doesnt allow
//Want to give the second dimension on the Method
istGewonnen = ZeileSpalteAufGewinnPruefen(_Spielfeld[zaehler] ,spieler);
}
return istGewonnen;
}
//This method want to become an Array
private static bool ZeileSpalteAufGewinnPruefen(int[] zeileSpalte, int spieler)
{
//Some further code
}
The compiler is saying: "Argument from type int[,] is not assignable to argument of type int[]. In Java it is working as i expected. Thanks in advance.