I'm trying to convert an integer to a character to write to a file, using this line:
fputc(itoa(size, tempBuffer, 10), saveFile);
and I receive this warning and message:
warning: implicit declaration of 'itoa'
undefined reference to '_itoa'
I've already included stdlib.h, and am compiling with:
gcc -Wall -pedantic -ansi
Any help would be appreciated, thank you.
-fpermissive
to see if the code works. – Shinitoa
in the "official" standard library. Apparently the standard library you are using does not provideitoa
. Your-pedantic
and-ansi
flags will not help anything. Quite the opposite, they can actually make things worse by hiding non-standard functions (I don't know whether they really do that). Try compiling without them. – Latency