I’m populating an array using a method however I receive 2 errors of a same issue
when trying to assign the hole array using the method and when returning the populated array in the method!
I’ve added explicit comments with the errors on the problematic lines
static void Main(string[] args)
{
uint n = uint.Parse(Console.ReadLine());
uint m = uint.Parse(Console.ReadLine());
int[,] array=new int [n,m];
array=FillArrayMethodC(n,m); //Cannot implicitly convert type 'int' to 'int[*,*]'
}
static int FillArrayMethodC(uint n, uint m)
{
int[,] a=new int [n,m];
//fill the array
return a; //Cannot implicitly convert type 'int[*,*]' to 'int'
}
How is the proper way of returning the whole array and assigning it!!!
Thank you for your help
BR
Change the return type of the FillArrayMethod.