From: "steve choi" <[EMAIL PROTECTED]>
Subject: Help: Integer to String

> char * posx;
> char * posy;
> FormPtr frmP;
>
> frmP=FrmGetActiveForm () ;
> posx = StrIToA (posx, (Int32)x) ;
> posy =StrIToA (posy, (Int32)y) ;

StrIToA converts an Int32 to Ascii (Char *), so that is the function you
want.  Your problem is that you aren't allocating any space for the
resulting string.  "char * posx" declares a pointer to a char but doesn't
allocate room for the string.  A simple way to do what you want is:

Char posx[4];    // assumes 3 digits max
Char posy[4];

StrIToA (posx, (Int32)x) ;
StrIToA (posy, (Int32)y) ;



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

Reply via email to