|
From: Ricardo R. <ri...@po...> - 2003-04-01 08:52:07
|
perhaps this example can help you a little more.
Ricardo.
**********ITOA/ATOI **********
#include <stdio.h>
#include <stdlib.h>
int main()
{
char cad[20];
/* the transformation: integer --> string */
itoa(2003,cad,10); // 2003 is the number to store in cad[]
printf(cad); // in decimal base = 10.
/* and the inverse transformation: string --> integer */
printf("\n %d",atoi(cad)); // cad[ ] is transformed to integer
printf("\n\n");
system("PAUSE");
return 0;
}
*************************************
|