# Zweidimensionales Array in C#



## krgewb (8. Jun 2019)

In Java kann ich so iterieren:

```
for (int y = 0; y < werte.length; y++) {
    for (int x = 0; x < werte[0].length; x++) {
                        
    }
}
```
In C# schaffe ich es nicht. Das ist mein Array:

```
int[,] werte = new int[6, 6];
```


----------



## httpdigest (8. Jun 2019)

https://stackoverflow.com/questions...-with-nested-foreach-statement#answer-2893367


----------



## Robat (8. Jun 2019)

Erster Google Eintrag 








						Iterate through 2 dimensional array c#
					

for(int k=0;k <= odds.GetLength(-1);k++) The above line of code is supposed to iterate through a two dimensional array of type Double but keeps throwing the following exception. Index Out Of Ra...




					stackoverflow.com


----------

