에 ltoa으로 코드를 컴파일 할 때 나는 컴파일 오류는 다음과 같이 얻을던지기 오류 리눅스
#include <stdlib.h>
main()
{
int val = 10;
char buff[10];
char *ptr;
ptr = ltoa(val,buff,10);
printf("The val is %s\n",buff);
}
아래와 같이 내가 코드를 컴파일하려고 할 때 나는 컴파일 오류가 점점 오전 :
[[email protected] ~]$ cc -g samp2.c
samp2.c: In function `main':
samp2.c:8: warning: assignment makes pointer from integer without a cast
samp2.c:11:2: warning: no newline at end of file
/tmp/ccifnKFx.o(.text+0x23): In function `main':
/home/mcanj/samp2.c:8: undefined reference to `ltoa'
collect2: ld returned 1 exit status.
이 문제를 해결하는 방법을 알려주세요. 고마워, 안부.
대신 실제로 sprintf를 사용해야합니다. –
http://stackoverflow.com/questions/190229/where-is-the-itoa-function-in-linux –