Public Sub Main()
Dim c As New Float[][2]
c[0] = [1.23, 2.34]
Print "c[0][0]", c[0][0]
Print "c[0][1]", c[0][1]
c[1] = [3.45, 4.56]
c[2] = [5.67, 6.78]
c[3] = [7.89, 8.90]
End
If you run this subroutine it runs until it tries to assign to c[2]. Is this expected behaviour? I expected it to fail when assigning to c]0]. I can get the behaviour I expected by adding the statement c.Clear immediately after the declaration.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?