|
|
| Author |
Message |
< Erlang ~ Converting an C array off bytes to an erlang list |
| noobidoo |
Posted: Fri Dec 19, 2008 2:29 pm |
|
|
|
Joined: 19 Dec 2008
Posts: 1
|
I tryed this:
Code:
void array2list(unsigned char* array, ETERM* alist[],int length)
{
int mack=0;
fprintf(stderr, "array to list::: \n\r");
while(mack<length){
alist[mack]=erl_mk_int(array[mack]);
fprintf(stderr, "%d ,", array[mack]);
mack++;
}
}
and then
Code:
resp = erl_format("{cnode, ~w,~w}", erl_mk_list(&e_datalis,d_length));
Just it returns some werd nubers that has nothing to do whit what the value in the array is. |
|
|
| Back to top |
|
|
|
All times are GMT
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum
|
|
|