I wrote a function to return the shift value for a certain character inputted. Where A, a = 0, B,b =1, etc.
int shift(char c)
{
int asc;
if (isupper(c))
{
asc = atoi(&c) - 65;
printf("%d", asc);
return asc;
}
else if(islower (c))
{
asc = atoi(&c) - 97;
printf("%d", asc);
return asc;
}
}
However I am getting a "control may reach end of non-void function" when I try to compile it, and I am not sure why. I am both printing and int and returning an int. Can anyone help with this?