int i;
char c;

c = 'x';
i = 'x';
i = c;
i = (int)c;


all of these work for me.  it depends on how you have your compiler
settings, but just "i = c" should work perfectly well for you.

you are using "int(c)", which is in fact C++ syntax, not C.  that is
probably your problem.


-----Original Message-----
From: Mansour A. Al-Saleh <[EMAIL PROTECTED]>
To: Palm Dev ML <[EMAIL PROTECTED]>
Date: Wednesday, March 31, 1999 1:36 AM
Subject: How to get the integer(ordinal number) value of a character?


>I use Code warrior 5. In C, one can write:
>        char c;
>        int i;
>
>        i = int (c);
>to get the integer value of the character c, unfortunately this is not
>acceptable by the Code Warrior compiler, so what is the way to get the
>integer value of an char ?


Reply via email to