I need to add numbers to my multidimensional array

  • Thread starter Thread starter keeponfalling
  • Start date Start date
K

keeponfalling

Guest
This is the code that I have so far:


int storeNumbers = int.Parse(Console.ReadLine());

string[,] storesemesterProfit = new string[storeNumbers, 4];



for(int m=0; m<storeNumbers; m++)
{
for(int n=0; n < 4; n++)
{

storesemesterProfit[m, n] = Console.ReadLine() ; //numbers to enter



}

}
}

The problem is that I have 4 numbers in a row: 10.00 20.00 30.00 40.00 ( 1 space between numbers)

I try with split.(' ') but is not enter the number in each column.

Any suggestion. I was thinking to use another for loop.

Continue reading...
 
Back
Top