Why it is compile time error when we use the params keyword with a multidimensional array?
using System;
namespace Testing_Params_Keyword
{
class Program
{
static void Main(string[] args)
{
//Calculate in invoked
Calculate(25.4, 26.2, 27.8, 28.9);
}
//Declearing Calculate method
public static void Calculate(params float [ , ] Money)//----** Here is error **
{
//Divide values of column1 by column2
float row1 = Money[0, 0] / Money[0, 1];
float row2 = Money[1, 0] / Money[1, 1];
Console.WriteLine(row1 + row2);
}//end of method Calculate
}
}
Gives me the error
The params parameter must be a single dimensional array
Why it must be single dimensional array?