المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : C# array



C# Programming
02-25-2010, 12:40 PM
Hi,
I am using the code below to generate a 10 by 10 matrix
I can run it through the main and console application. If I wanted to create a class how would refer to the class? What would be the simple code to create a new instance of the class and run the Generate() method? Would it be random.Generate()?



public static void Generate()
{

//Declaring Array
int [,]Arry=new int[10,10];
//Random Class
Random random = new Random();
string str = string.Empty;

//Loop ith element
for (int i=0; i