[英]Julia how to create an array of type(structure as C)?
如何創建具有以下參數類型的數組
type :: test
x :: Int32
y :: Float32
end
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
)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.