I have a problem that I cannot understand and cannot implement this type of control. Can someone explain to me (graphically) in a simple way the concept and how to implement a 3-dimensional array?
I have a problem that I cannot understand and cannot implement this type of control. Can someone explain to me (graphically) in a simple way the concept and how to implement a 3-dimensional array?
One-dimensional array:
Two-dimensional array:
Three-dimensional arrangement (here it gets difficult graphically ;))
In code:
or in ASCII art:
To assign values directly at declaration time, there are two forms of syntactic sugar:
either
Obviously here you can also add dimensions:
either
or for three-dimensional arrangements
either
I suppose that it can be deduced how it works for more dimensions, when I have time I promise to add more under the BEERWARE-LICENSE .