Such a royal pain to comprehend on why something so simple can be so cryptic. Back when I was learning VB6 14 years ago, doing empty arrays in structures to be redeclared later wasnt so hard:
Private Type MyStruct MyArray() As Byte End Type Dim Test As MyStruct Private Sub Form_Load() ReDim Test.MyArray(10) As Byte End Sub
Even with VB.Net theres no issue:
Public Class Form1 Private Structure MyStruct Dim MyArray() As Byte End Structure Dim Test As MyStruct Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ReDim Test.MyArray(10) End Sub End Class
And although itll work in C++ to use a pointer and make it an array later (I think), I still kinda find it funny that you have to go through including the library vector, using vector<your data type here>, Resizing the vector, store the address of the vector into a pointer buffer to be used as an array by static_casting<char *>, load the data into that buffer and possibly put it back into the vector array. Mega fail Microsoft on not keeping it simple.