# Passing an array of structures through \`ccall\`

**URL:** <https://discourse.julialang.org/t/passing-an-array-of-structures-through-ccall/5194>\
**Category:** General Usage\
**Tags:** question\
**Created:** [August 2, 2017, 9:35pm UTC](https://discourse.julialang.org/t/passing-an-array-of-structures-through-ccall/5194 "2017-08-02T21:35:16Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![Michael\_Eastwood](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/michael_eastwood/32/669_2.png) [@Michael\_Eastwood](https://discourse.julialang.org/u/Michael_Eastwood)\
**Post date:** [August 2, 2017, 10:56pm UTC](https://discourse.julialang.org/t/passing-an-array-of-structures-through-ccall/5194/5 "2017-08-02T22:56:36Z")

</div>

I don’t believe it is possible to have `st_test` mutable and have it stored contiguous in memory in an array.

But is mutability of the array elements actually important? Or is it ok to do something like the following when you need to update an element of the list:

```julia
old_element = array[1]
new_element = st_test(4, old_element.d, old_element.s, old_element.a, old_element.b)
array[1] = new_element

```

You can hide this messiness behind a helper function for now, but I believe there is syntax on the horizon that will make this less annoying

[https://github.com/JuliaLang/julia/pull/21912](https://github.com/JuliaLang/julia/pull/21912)

---

_[View the full topic](https://discourse.julialang.org/t/passing-an-array-of-structures-through-ccall/5194)._
