PSoC >> PSoC Mixed-Signal Array

Pages: 1
Poppe
newbie


Reged: Nov 15 2007
Posts: 36
Loc: Burlington, Vermont, USA
ITOA()
      #62642 - Fri Jun 27 2008 02:55 PM

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


Post Extras: Print Post   Remind Me!   Notify Moderator  
Dan HenryModerator
Guru
****

Reged: Oct 16 2003
Posts: 3401
Loc: Boulder, Colorado U.S.A.
Re: ITOA() [Re: Poppe]
      #62682 - Fri Jun 27 2008 03:12 PM

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.


Post Extras: Print Post   Remind Me!   Notify Moderator  
clydeAdministrator
HI-TECH team member
*****

Reged: Oct 16 2003
Posts: 633
Re: ITOA() [Re: Poppe]
      #62842 - Sun Jun 29 2008 05:47 PM

Yes, itoa() does null terminate. However itoa() is a non-standard function, and we recommend using sprintf() instead.

Clyde


Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1



Extra information
3 registered and 2 anonymous users are browsing this forum.

Moderator:  ndouglas, Dan Henry, jtemples, jeff, Andrew L, mikerj, dave g, meisty, josh stevo 

Print Topic

Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is enabled
      UBBCode is enabled

Rating:
Topic views: 877

Rate this topic

Jump to

Contact Us | Privacy statement HI-TECH Software

Powered by UBB.threads™ 6.5.5