The code below is my attempt at creating a mutable struct that has an Array as a field.
Does this seem to be the correct method of creating the Array?
It seems a little unnatural of how the length and dims are created after the fact!
#-- a mutable struct containing two vars and an array
mutable struct MyData
Hits::Int #-- var1 of type Int
Skips::Int #-- var2 of type Int
SomeArray::Array{Int} #-- Array type of Int => Note: no dims or length seem to be allowed
end
#--- intialize VarData in following two lines
VarData = MyData(0, 0, repeat(0:0, outer = 12)) #--- initialize vars to 0, and Array to length 12x1 with val 0
VarData.SomeArray = reshape(VarData.SomeArray, 4,3) #-- reshape Array into desired dims of 4x3
#--- is there a (better) way to combine the preceeding two lines into one line?