EmbeddedRelated.com
Forums

: IAR string conversion

Started by Paulo Ricardo August 18, 2005
Hi,

I'm looking for functions like "itoa()" and "atoi()"
in IAR compiler docs, but I have not found nothing.

Someone know if these functions are native to IAR
compiler or I need to do it myself?


TIA,

-Paulo

Beginning Microcontrollers with the MSP430

Hello Paulo,

atoi() belongs to stdlib ... just /#include <stdlib.h>/ it.
For int to asc I use /sprintf (str, "%ld", Int)/ for numbers in
decimal format (I think it is your case)

You can make multiple division by 10 and add 0x30 to each result. This resuts you could put in strings bytes.

I hope I had helped.

Regards,

Renato
Renato,

Your tip is very helpful. That is what I'm looking for.

Regards,

-Paulo