passing arg makes pointer to integer without a cast
From the code below i get the following warning message from the display_char function.
warning: passing arg 1 of 'valid char' makes pointer to integer without a cast
Code:
void display_char(char c, char position)
{
if(position > 5)
{
return;
}
if (valid_char(c) == 0);
{
return;
}
TextBuffer[position] = c;
}
Code:
int valid_char(char *check)
{
char i,j, k;
char validChar[] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '*', '+', '-', '.', ' ', '_', '\0'};
char validCharSize = 0;
char inputCharSize = 0;
char valid = 0;
for(i = 0; validChar[i] != '\0'; i++)
{
validCharSize++;
}
for(i = 0; check[i] != '\0'; i++)
{
inputCharSize++;
}
for(j = 0; j <= inputCharSize; j++)
{
for(k = 0; k < validCharSize; k++)
{
if(check[j] == validChar[k])
{
valid++;
}
}
}
if(valid == inputCharSize)
{
return 1;
}
else
{
return 0;
}
}
I don't really get what the warning message is saying and so it was no surprise to be when my attepmts to fix this failed.
Any help would be greatly appreciated.
Thanks
-Nick