<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jun 20, 2016 at 3:04 PM, John Duffy <span dir="ltr"><<a href="mailto:jb_duffy@btinternet.com" target="_blank">jb_duffy@btinternet.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">Hi<div><br></div><div>I'm using FreeBSD 10.3 & Erlang 18.3 and I'm trying to get to grips with passing a binary of floats to a NIF for further processing as as array of C doubles.</div><div><br></div><div>My simple NIF module compiles and I can access my "my_nif_1" function from the erlang shell. I can access the 'size' structure member but I can't figure out how to access the 'data' structure member as a C array. I understand that 'data' is a block of memory of UINT bytes but I can't figure out how to "cast" this to a C array within the NIF.</div></blockquote><div><br></div><div>This doesn't answer your casting question, but is there a reason you're using a binary and not a resource? See the "Resource Objects" section underĀ <a href="http://erlang.org/doc/man/erl_nif.html">http://erlang.org/doc/man/erl_nif.html</a> .</div><div><br></div><div>--steve</div></div></div></div>