c# - Creating multidimensional array at runtime -


i did research on web couldn't find advice how dynamically create multidimensional (rank >1) array (it jagged array).

in other words program ask number of dimensions (rank) first, number of elements per dimension (rank) , create array.

is possible?

multidimensional no, no problem jagged - here simple example:

using system; using system.collections.generic;  public class program {     public static void main()     {          list<list<list<int>>> myjaggedintlist = new list<list<list<int>>>();          myjaggedintlist.add(new list<list<int>>());         myjaggedintlist[0].add(new list<int>());         myjaggedintlist[0][0].add(3);          console.writeline(myjaggedintlist[0][0][0].tostring());     } } 

each item in first list list, each item in second list list, , each item in third list int. what's problem that?

play in fiddle.


Comments

Popular posts from this blog

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -

javascript - Using jquery append to add option values into a select element not working -

javascript - Restarting Supervisor and effect on FlaskSocketIO -