S
silverburgh.meryl
Hi,
Can you please tell me where I can find itoa()?
I try to compile the following example, but I get the following error:
.../t.cpp:20:2: warning: no newline at end of file
.../t.cpp: In function 'int main()':
.../t.cpp:13: error: 'itoa' was not declared in this scope
/* itoa example */
#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);
itoa (i,buffer,16);
printf ("hexadecimal: %s\n",buffer);
itoa (i,buffer,2);
printf ("binary: %s\n",buffer);
return 0;
}
Thank for any help.
Can you please tell me where I can find itoa()?
I try to compile the following example, but I get the following error:
.../t.cpp:20:2: warning: no newline at end of file
.../t.cpp: In function 'int main()':
.../t.cpp:13: error: 'itoa' was not declared in this scope
/* itoa example */
#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);
itoa (i,buffer,16);
printf ("hexadecimal: %s\n",buffer);
itoa (i,buffer,2);
printf ("binary: %s\n",buffer);
return 0;
}
Thank for any help.