Declare and initialize array of arrays
Posted
#1
(In Topic #823)
Trainee
So I have two questions:
- What is the idiomatic way of populating an array of arrays?
- What is the idiomatic way of declaring a fixed size array of arrays?
Posted
Regular

kwhitefoot said
So I have two questions:
- What is the idiomatic way of populating an array of arrays?
- What is the idiomatic way of declaring a fixed size array of arrays?
If you certainly know that you need 4 rows with 2 columns, you should create a two-dimensional array:
If you want to use array of arrays instead of two-dimensional array, you should do such thing:
Posted
Guru

Code (gambas)
- Dim sRoman As String[][] = [[""], ["", "M", "MM", "MMM", "MMMM", "MMMMM", "MMMMMM", "MMMMMMM", "MMMMMMMM", "MMMMMMMMM"], ["", "C", "CC", "CCC", "CD", "D", "DC", "DCC", "DCCC", "CM"], ["", "X", "XX", "XXX", "XL", "L", "LX", "LXX", "LXXX", "XC"], ["", "I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX"]]
Also have a look here.
1 guest and 0 members have just viewed this.


