This question already has an answer here:
(这个问题在这里已有答案:)
I tried this example:
(我试过这个例子:)
/* 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
",buffer);
itoa (i,buffer,16);
printf ("hexadecimal: %s
",buffer);
itoa (i,buffer,2);
printf ("binary: %s
",buffer);
return 0;
}
but the example there doesn't work (it says the function itoa
doesn't exist).
(但那里的例子不起作用(它表示itoa
不存在的功能)。)
ask by janko-m translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…