for (int i = 0; i < 9; ++i) { test[i] = 1; // arr[i] = [9]{1,2,3}; //test[i]={1,2,3}; for (j = 0; j < 2; ++j) { int[][] test = new int[] { 1, 2, 3 }; } }
for(int i =0; i < 3; ++i) { for(int j =0; j < 3; ++j) { // add items here } }
//declare new 2d array int[,] test=new int[9,3]; for (int i = 0; i < 9; ++i) { for (int j = 0; j < 3; ++j) { //setting value for each element test[i, j] = 1; } } //writing the elements in console window foreach (int i in test) { // MessageBox.Show(i.ToString()); Console.WriteLine(i); }
string[,] arr = new string[,] { {"A", "F"}, {"B", "G"}, {"C", "H"}, {"D", "I"}, {"E", "J"} };
for(i=0 ; i<now_of_rows; i++ ) { for(j=0 ; j<now_of_cols ; j++) { arr[i][j] = //assign your value here } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)