简体   繁体   English

在Erlang中表示C数组的最佳方法是什么?

[英]What is the best way to represent a C array in Erlang?

What is the best way to represent a C array in Erlang? 在Erlang中表示C数组的最佳方法是什么? I plan on passing a C array to Erlang using NIF. 我计划使用NIF将C数组传递给Erlang。 The array is composed of bytes and I'll need to modify some of the bytes as the program runs. 该数组由字节组成,我需要在程序运行时修改一些字节。 Any help is appreciated. 任何帮助表示赞赏。

如果NIF中的函数没有重新分配数组,那么你可以将数组表示为具有两个元素的元组 - 原始指针和元素计数。

erlang is pretty good when dealing with binaries(essentially byte arrays right?) 处理二进制文件时,erlang非常好(基本上是字节数组吗?)

check it out here: http://www.erlang.org/documentation/doc-5.6/doc/programming_examples/bit_syntax.html 在这里查看: http//www.erlang.org/documentation/doc-5.6/doc/programming_examples/bit_syntax.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM