[erlang-questions] how do I convert a character to an integer (dict broke the integer I put into it)

Robert Virding rvirding@REDACTED
Sun Dec 16 11:44:34 CET 2007


Could you please give an example of what you mean? In Erlang strings are
just lists of integers, and a character is just an integer. So "abc" is
[97,98,99] and $A is 65.

Robert

On 16/12/2007, Dominic Chambers <dominic.chambers@REDACTED> wrote:
>
> Hi Everyone,
>
> I add some integers as values into a dict, but when I go to retrieve
> them they are now strings. After an hour of googling the only thing I
> can find online is that $c does what I want for character literals,
> but this doesn't seem to work for character variables. I need this
> because adding to the number I get out of the dict gives me a badarith
> error.
>
> Thanks for any help, Dominic.
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20071216/8339bb7b/attachment.htm>


More information about the erlang-questions mailing list