# Memcpy in julia

**URL:** <https://discourse.julialang.org/t/memcpy-in-julia/67791>\
**Category:** Performance\
**Tags:** question\
**Created:** [September 7, 2021, 7:01am UTC](https://discourse.julialang.org/t/memcpy-in-julia/67791 "2021-09-07T07:01:09Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Sukera](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@Sukera](https://discourse.julialang.org/u/Sukera)\
**Post date:** [September 7, 2021, 7:29am UTC](https://discourse.julialang.org/t/memcpy-in-julia/67791/3 "2021-09-07T07:29:02Z")

</div>

I see now that you’ve edited your question (which was about 4 `UInt8` instead of 5).

If you show code, please surround it in triple backticks (```) to make it easier to read & follow, and ultimately to [make it easier to help you](https://discourse.julialang.org/t/please-read-make-it-easier-to-help-you/14757).

* * *

I’m not sure using `memcpy` to interpret 5 bytes as two `Int32` works in C either - you’ll interpret bytes outside of the array as part of the last `Int32`, which is a dangerous thing (and probably undefined behavior as well). Where do you get those bytes from? What do you want to do with them?

---

_[View the full topic](https://discourse.julialang.org/t/memcpy-in-julia/67791)._
