# Dereference a pointer

**URL:** <https://discourse.julialang.org/t/dereference-a-pointer/6251>\
**Category:** General Usage\
**Created:** [October 4, 2017, 8:36pm UTC](https://discourse.julialang.org/t/dereference-a-pointer/6251 "2017-10-04T20:36:48Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![yuyichao](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yuyichao/32/20_2.png) [@yuyichao](https://discourse.julialang.org/u/yuyichao)\
**Post date:** [October 5, 2017, 1:52pm UTC](https://discourse.julialang.org/t/dereference-a-pointer/6251/6 "2017-10-05T13:52:56Z")

</div>

> [@Frank\_Applin](#):
>
> Wouldn’t it have to be an address to a block of memory? How would you write a ccall for i2c\_smbus\_read\_block\_data - for instance?

Since you need a block of memory, you should, well, allocate that block of memory. In principle, C requires certain alignment so you should also allocate it with the max alignment you might need, in this case, the size is at least 34bytes and the alignment is 4 so you should use a `Int32` tuple/array that is at least 36bytes in size (i.e. 9 elements). Either `Vector{Int32}(9)` or `Ref{NTuple{9,Int32}}()` works with `Ptr{Void}` as the argument type.

---

_[View the full topic](https://discourse.julialang.org/t/dereference-a-pointer/6251)._
