> 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.

  actually.. it is like that for a reason (to my interpretation).

  i believe that StrIToA will return NULL if the translation fails.
  it is like the standard "routines" in C..

    ie: fscanf(f, "...", &...)

  it returns an "int", which says how many successfull conversions 
  there were.. 

  same goes with StrIToA(c,i). if "i" causes a problem (which probably
  wont happen with THIS function), then 'c' is not clobbered.. and an
  error code is returned with the function (being NULL or something).

  does that make a bit more sense?

  C programming does not force you to assign a function call to a value
  (ie: you can make a function look like a procedure)..

  its just C :P function return codes are normally for error checking.

  my 2c.

az. 
--
Aaron Ardiri 
Lecturer                       http://www.hig.se/~ardiri/
University-College i G�vle     mailto:[EMAIL PROTECTED]
SE 801 76 G�vle SWEDEN       
Tel: +46 26 64 87 38           Fax: +46 26 64 87 88
Mob: +46 70 352 8192           A/H: +46 26 10 16 11

Reply via email to