[erlang-questions] Conversion of string into Ascii values ??

J Bhanot j.bhanot@REDACTED
Thu Feb 28 13:19:53 CET 2008


Hi,

I am bit confused in C node for this......beacuse when i send "abc" from 
Erlang node to C.....

I have used all this to check the type.......where buff is the message 
from Erlang node i.e. "abc"

 k = ERL_IS_INTEGER(buff);
  fprintf(stderr, " intType %d\n\r", k);

        k = ERL_IS_UNSIGNED_INTEGER(buff);
  fprintf(stderr, " uintType %d\n\r", k);

        k = ERL_IS_FLOAT(buff);
  fprintf(stderr, " fltType %d\n\r", k);
        k = ERL_IS_ATOM(buff);
  fprintf(stderr, " atomType %d\n\r", k);
        k = ERL_IS_PID(buff);
  fprintf(stderr, " pidType %d\n\r", k);
        k = ERL_IS_PORT(buff);
  fprintf(stderr, " portType %d\n\r", k);
        k = ERL_IS_REF(buff);
  fprintf(stderr, " refType %d\n\r", k);
        k = ERL_IS_TUPLE(buff);
  fprintf(stderr, " tupType %d\n\r", k);
        k = ERL_IS_BINARY(buff);
  fprintf(stderr, " binType %d\n\r", k);
        k = ERL_IS_LIST(buff);
  fprintf(stderr, " listType %d\n\r", k);
        k = ERL_IS_EMPTY_LIST(buff);
  fprintf(stderr, " elistType %d\n\r", k);
        k = ERL_IS_CONS(buff);
  fprintf(stderr, " consType %d\n\r", k);


Now, it gives true for int type ..............and hence I have to use 
erl_mk_int.....which gives me values in Ascii in C node...

Is there a way in which I get abc in C node instead of Ascii values..

Thanks,
jb
=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. Thank you


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20080228/1972fadf/attachment.htm>


More information about the erlang-questions mailing list