[erlang-questions] [Erlang][Request] Invoke C funtion in Erlang

郎咸武 langxianzhe@REDACTED
Wed Dec 14 13:30:17 CET 2011


hi,
I using nif mehod to Invoke C funtion in Erlang.
come code:
1,
char *y;
if (!enif_get_string(env, argv[0], y, *sizeof(y)*, ERL_NIF_LATIN1))

I input "123456" args, but only return "123".

2,char *y;
if (!enif_get_string(env, argv[0], y, *10*, ERL_NIF_LATIN1))

this only appear Segmentation fault

I have no idea.
Please help me.

Thanks.
>From jason.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20111214/ac7b2659/attachment.htm>


More information about the erlang-questions mailing list