Like Fergal said, it's exactly the same...

It's all depend on how you want it to viewed. You can view it as an integer,
so you will get 97 or as a char, you will get 'a' or even in hex, and you
will get 0x6b.

Funny example :
  char ch;
  int    value;

  ch = '0';
  value = ch - '0';         you will get value = 0 (integer)

  ch = '1';
  value = ch - '0';         will give you value = 1 (integer),

  as if you do  49 (ASCII code for '1') - 48 (ASCII code for '0' )


In C, you don't need to convert them using "chr" or "ord"


Cordialement,
Agus Silas
BST Technologies
T. (+33) 5 57 80 16 03
F. (+33) 5 57 77 29 97
http://www.bst-technologies.com

********************************************
********************************************

-----Message d'origine-----
De : [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]De la part de Fergal
Moran
Envoy� : jeudi 4 juillet 2002 15:43
� : Palm Developer Forum
Objet : RE: Convert ascii value to character


In C a char is an ascii value so you can use
  char ch = 97;
Or
  char ch = 'a';

Both are pretty much equivalent.

Fergal.

> -----Original Message-----
> From: Ben Leung [mailto:[EMAIL PROTECTED]]
> Sent: 04 July 2002 14:47
> To: Palm Developer Forum
> Subject: Convert ascii value to character
>
>
> Hi,
>
> I would like to convert an ascii value to a character.  Like
> in VB, we can use
>
>       chr(97)  ==> 'a'
>
> Is there an equivalent function in Palm?
>
>
> Thanks,
> Ben
>
>
> --
> For information on using the Palm Developer Forums, or to
> unsubscribe, please see http://www.palmos.com/dev/support/forums/
>

--
For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/


--
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to