c# - Use array inside multidimensional array -


i've been looking @ different answers , stuff (like jagged array) still cant understand how work (or if works). in end, should arduino uses writing> aside. here's problem:

i want make multidimensional array represents letters alphabet. each index has 2 arrays; 1 directions , 1 rotations. this:

  |      0       |      1      | 0 | directions[] | rotations[] | 1 | directions[] | rotations[] | ................................ 25| directions[] | rotations[] | 

how 1 accomplish this? accomplishable? i'm using in c#, have convert c eventually. or insight appreciated. in advance!

edit: new code letterdata class , example values

public class letterdata     {         public int[] distance;         public int[] rotation;     }      public letterdata[] sequence = new letterdata[25];      void start ()      {          (int = 0; < 25; i++)         {             sequence[i].distance = new int[2];             sequence[i].rotation = new int[2];         } } 

how simplifying?:

public class letterdata {     public directionstype[] directions;     public rotationstype[] rotations; }  letterdata[] myvar = new letterdata[25]; ... myvar[i].directions = new directionstype[n]; ... myvar[i].directions[k] = value; 

answer edit:

public class letterdata     {         public int[] distance;         public int[] rotation;     }  public class myclass {     public letterdata[] sequence = new letterdata[25];      void start ()      {         (int = 0; < 25; i++)         {             sequence[i] = new letterdata();             sequence[i].distance = new int[2];             sequence[i].rotation = new int[2];         }     } }  ...  myclass m = new myclass(); m.start(); 

Comments

Popular posts from this blog

php - SPIP: From Tag directly to an article -

jquery - isAjaxRequest always return false -

ruby on rails - In a controller spec, how to find a specific tag in the generated view? -