Implicit Declaration of Function ‘Atoi’?
Why Am I Getting an Error When Using the Atoi() Function? #Include #Include Int Main() { Char S1[10], S2[10]; Int X=5, Y=6, Z; Sprintf(S1, "%D", X)...
Why am I getting an error when using the atoi() function?
#include <stdio.h>
#include <string.h>
int main()
{
char s1[10], s2[10];
int x=5, y=6, z;
sprintf(s1, "%d", x);
sprintf(s2, "%d", y);
strcat(s1, s2);
z = atoi(s1);
printf("%d, %s", z, s1);
return 0;
}
1 Answer
#include <stdlib.h>
Will fix it.