2D数组中的索引超出范围异常(C#)

Jur*_*nce 5 c# arrays 2d indexoutofboundsexception

char[,] map = new char[10, 20];

for (int i = 0; i < map.GetLength(0); i++)
{
    for (int j = 0; i < map.GetLength(1); j++)
        map[i, j] = '.';
}
Run Code Online (Sandbox Code Playgroud)

我只是想让map [i,j]的所有元素成为一个点,但总是当我尝试运行它时,编译器会说:索引超出范围异常.也许这是一个愚蠢的问题,但我不得不问它.

I4V*_*I4V 6

请参阅ij循环中的内容

for (int j = 0; j < map.GetLength(1); j++)
Run Code Online (Sandbox Code Playgroud)