Initialize an array (or other structure), add

You can initialize it as:

julia> arr = Array{Tuple{Int, Int}}(undef, 3, 2)
3×2 Matrix{Tuple{Int64, Int64}}:
 (0, 0)  (0, 0)
 (0, 0)  (0, 0)
 (0, 0)  (0, 0)

The values aren’t guaranteed to be (0, 0) when using the undef initializer, but that should be fine here since you’re going to be replacing them anyway. If you do need them to be (0, 0), you can use fill instead.

julia> arr = fill((0, 0), 3, 2)
3×2 Matrix{Tuple{Int64, Int64}}:
 (0, 0)  (0, 0)
 (0, 0)  (0, 0)
 (0, 0)  (0, 0)
1 Like