You a few options to solve the scenario you are facing.
Firstly, and more directly to your questions, you can declare the size of an array dynamically like this:
'Say I am getting data from the database, and i don't know how
'many rows I am getting...
'At somepoint, I will get a count for the amount of data coming back, and when I get that 'count' i can declare the array like so:
Dim RowCount as Integer = 15
Dim DynamArray(RowCount) As Integer
'Now DynamArray's bounds are 0 - 14
'You can also declare an array with no size:
Dim DynamArray() as Integer
'Then change the length afterwards:
ReDim DynamArray(RowCount)
'And Finally, if you want to add an item to the array:
ReDim Preserve DynamArray(DynamArray.Length)
DynamArray(DynamArray.Length - 1) = Value
Since you understand how to do this enough to have done it in C++, I won't bore you with details... Here is another way to do it, look into using an arrayList, it dynamically holds multiple datatypes
Dim aList As New ArrayList
aList.Add(Object)
aList.Count
aList.Item(0)