I would like to clarify something in what I said previously. The prototype
for Palm's StrIToA function is really:
CharPtr StrIToA (CharPtr s, Long i)
I should not have said the syntax is "just" StrIToA(c, value).
As someone coming from a VB background to C, and sensing the questioner
being new to C also, I wanted to make the point that you are not required to
use an assignment operator ("=", as in: c = StrIToA(c, i) ) to store the
character translation of the numeric value. There are situations where using
an assignment would serve a useful purpose, but the basic task of converting
an integer to a string can be efficiently done without it.
Mitch
> -----Original Message-----
> From: Fawcett, Mitch
> Sent: Wednesday, June 02, 1999 8:53 AM
> To: '[EMAIL PROTECTED]'
> Subject: RE: StrIToA ???
>
> 1) You need to allocate space for c before the StrItoA statement.
> 2) the syntax is just StrIToA(c, value); don't need the s=
>
> -----Original Message-----
> From: pete moss [SMTP:[EMAIL PROTECTED]]
> Sent: Tuesday, June 01, 1999 4:36 PM
> To: [EMAIL PROTECTED]
> Subject: StrIToA ???
>
> I am trying to use this function to convert a number to a string to
> show
> up in a label. i am doing something like this:
>
> ....
> Long value;
> CharPtr s, c;
>
> s=StrIToA(c, value);
> ....
>
>
> whenever i have this line in my code, POSE crashes with a 'bus
> error'.
> this happens whether i use s or c or not. if i comment out this
> line
> then no problems. anyone know what is wrong with this? also, why
> does
> it return a CharPtr and also set another CharPtr (returns s and sets
> c)? which variable holds the string version of value? why isnt it
> defined like CharPtr StrIToA(Long i) ?
>
> also, what is a 'bus error'?
>
> pete