linux下的itoa()
一个itoa代码如下:
#include <stdlib.h>
#include <stdio.h>
int main(void)
{
int number = 12345;
char string[25];
itoa(number, string, 10);
printf("integer = %d string = %s\n", number, string);
return 0;
}
编译的时候报错:
[ellen@localhost str_test]$ gcc -o stars_1 stars_1.c
/tmp/cccyMZwf.o(.text+0x24): In function `main':
: undefined reference to `itoa'
collect2: ld returned 1 exit status