我的编码有什么问题...?阵列附加异常错误:
这是我添加二维数组的编码。当我调试我的编码,然后未处理的异常system.format.something的时...
代码..
static void Main(string[] args)
{
int[,] a = new int[4, 4]
{ { 1, 1, 1, 1 },
{ 1, 1, 1, 1 },
{ 1, 1, 1, 1 },
{ 1, 1, 1, 1 } };
int[,] b = new int[4, 4]
{ { 2, 2, 2, 2 },
{ 2, 2, 2, 2 },
{ 2, 2, 2, 2 },
{ 2, 2, 2, 2 } };
int[,] c = new int[4, 4];
for (int row = 0; row < 4; row++)
{
for (int col = 0; col < 4; col++)
{
c[row, col] = a[row, col] + b[row, col];
}
}
for (int row = 0; row < 4; row++)
{
for (int col = 0; col < 4; col++)
{
Console.Write("The value of {0},{1}", c[row, col]);
}
}
}
究竟是什么异常?在哪一行?并根据您的具体问题[写一个更好的标题](http://meta.stackexchange.com/q/10647/158761)。 –