In a class right now so have to make a brief response but to populate a multidimensional array you could create a nested loop.
Example:
I am not completely sure if that answered your question but if not I am sure one of the more knowledgeable members will come in and help you shortly. If not when I get a chance later I will try to help out with more detail.Code:static void Main(string[] args) { Random rnd = new Random(); int[,] numList = new int[3, 2]; for (int i = 0; i < 3; i++) { for (int j = 0; j < 2; j++) { numList[i, j] = rnd.Next(1,11); } } for (int i = 0; i < 3; i++) { for (int j = 0; j < 2; j++) { Console.WriteLine(numList[i, j]); } } // Pause application. Console.Write("Press any key to continue..."); Console.ReadKey(); }




Reply With Quote