如何创建具有以下参数类型的数组
type :: test
x :: Int32
y :: Float32
end
答案 0 :(得分:1)
julia> struct Test
x::Int32
y::Float32
end
julia> f = open("rand.bin","r")
julia> read(f, Test, 1)
1-element Array{Test,1}:
Test(55238752, 1.67109)
(对于Julia 0.5,请使用immutable
而不是struct
)