http://www.cplusplus.com/reference/cstdlib/itoa/?kw=itoa I used the example here, but it says there's no itoa.
What's wrong with you?
itoa doesn't exist
#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;
}
Because itoa is not a standard function. Depending on the development environment, it may or may not be itoa.
Write sprintf() instead of itoa.
int aInt = 368;
char str[15];
sprintf(str, "%d", aInt);
© 2024 OneMinuteCode. All rights reserved.