0

how to use the( itoa) function in string and what is the library for it? please.

1st Jun 2017, 6:45 PM
wissam
3 Answers
+ 5
it is not a standard function Prototype char * itao ( int value, char * str, int base );
1st Jun 2017, 7:39 PM
Emore Anzolin
Emore Anzolin - avatar
+ 3
itoa converts integer to string and belongs to stdlib.h #include <stdio.h> #include <stdlib.h> int main () { int i; char buffer [33]; printf ("Enter a number: "); scanf ("%d",&i); itoa (i,buffer,10); printf ("decimal: %s\n",buffer); }
1st Jun 2017, 7:36 PM
Emore Anzolin
Emore Anzolin - avatar
+ 1
thank you...
3rd Jun 2017, 8:49 PM
wissam