# How do you correctly align array memory when using unsafe\_store! to write a struct array to a c or fortran program?

**URL:** <https://discourse.julialang.org/t/how-do-you-correctly-align-array-memory-when-using-unsafe-store-to-write-a-struct-array-to-a-c-or-fortran-program/93868>\
**Category:** General Usage\
**Tags:** question\
**Created:** [February 1, 2023, 10:50am UTC](https://discourse.julialang.org/t/how-do-you-correctly-align-array-memory-when-using-unsafe-store-to-write-a-struct-array-to-a-c-or-fortran-program/93868 "2023-02-01T10:50:29Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)\
**Post date:** [February 1, 2023, 2:29pm UTC](https://discourse.julialang.org/t/how-do-you-correctly-align-array-memory-when-using-unsafe-store-to-write-a-struct-array-to-a-c-or-fortran-program/93868/2 "2023-02-01T14:29:51Z")

</div>

Related posts:

- [How can you insert a julia struct into an array of a type in fortran?](https://discourse.julialang.org/t/how-can-you-insert-a-julia-struct-into-an-array-of-a-type-in-fortran/93775)
- [How can you modify global variables that are used in functions that are being called with ccall?](https://discourse.julialang.org/t/how-can-you-modify-global-variables-that-are-used-in-functions-that-are-being-called-with-ccall/93644)
- [How do you reference a symbol from a specific module in a fortran shared object library with the ccall utility?](https://discourse.julialang.org/t/how-do-you-reference-a-symbol-from-a-specific-module-in-a-fortran-shared-object-library-with-the-ccall-utility/93580)

---

_[View the full topic](https://discourse.julialang.org/t/how-do-you-correctly-align-array-memory-when-using-unsafe-store-to-write-a-struct-array-to-a-c-or-fortran-program/93868)._
