Poppe
newbie
Reged: Nov 15 2007
Posts: 36
Loc: Burlington, Vermont, USA
|
|
May I assume that the string returned by itoa() is null terminated? The Manual is silent on this point:
Description The function itoa converts the contents of val into a string which is stored into buf. The conversion is performed according to the radix specified in base. buf is assumed to reference a buffer which has sufficent space allocated to it.
Martin
|
Dan Henry
Guru
  
Reged: Oct 16 2003
Posts: 3401
Loc: Boulder, Colorado U.S.A.
|
|
Quote:
May I assume that the string returned by itoa() is null terminated?
I believe you can. A string, by definition, is NUL-terminated. That is, if an array of chars is not NUL-terminated, then it is not a string.
|
clyde
HI-TECH team member
   
Reged: Oct 16 2003
Posts: 633
|
|
Yes, itoa() does null terminate. However itoa() is a non-standard function, and we recommend using sprintf() instead.
Clyde
|