Use a single for loop to assign a two-dimensional array : Multi Dimensional Array : Data Structure C# Examples


C# Examples » Data Structure » Multi Dimensional Array »

 

Use a single for loop to assign a two-dimensional array









    
using  System;

class  MainClass
{
    static  void  Main(string[]  args)
    {
        //multidimensional  array
        int[,]  MyIntArray  =  new  int[5,  5];

        for  (int  x  =  0,  y  =  0;  x  <  5;  x++,  y++)
        {
            MyIntArray[x,  y]  =  0;
        }
    }
}
    
   
  
   




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Data Structure
» Multi Dimensional Array