I'm creating a program that convert a binary number to a hexadecimal one. This is my function
int cnt(int num)
{
    int cn=0;
    while (num!=0)
    {
        cn++;
        num=num/10;
    }
    return cn;
}
int bintodec(int bin)
{
    int cn=cnt(bin),result,a=1,i;
    int A=0;
    for (i=1;i<=cn;i++)
    {
        A=A+(bin%10)*(a);
        a=a*2;bin=bin/10;
    }
    return A;
}
int *dectohex(int dec)
{
    int cn=cnt(dec),i;
    int A[cn];
    for (i=1;i<=cn;i++)
    {
        A[cn-i]=dec%16;
        dec=dec/16;
    }
    return A;
}
This is my caller:
int main()
{
    int i,x;
    printf("x = ");scanf("%d",&x);
    for (i=1;i<=5;i++)
    {
        if (dectohex(x)[i]<10)
        {
            printf("\t%d",dectohex(x)[i]);
        }
        else if (dectohex(x)[i]==10)
        {
            printf("\tA");
        }
        else if (dectohex(x)[i]==11)
        {
            printf("\tB");
        }
        else if (dectohex(x)[i]==12)
        {
            printf("\tC");
        }
        else if (dectohex(x)[i]==13)
        {
            printf("\tD");
        }
        else if (dectohex(x)[i]==14)
        {
            printf("\tE");
        }
        else if (dectohex(x)[i]==15)
        {
            printf("\tF");
        }
    }
return 0;
}
It worked well together in an empty file, no error when built, and it printed correct results. But just when I add them to my project, errors appear everywhere I called the function dectohex() like in this image building logs. Did I do something wrong???
 
    