Is there any easier way to do the following in c?
unsigned short check_str(char *str)
{
while (*str)
{
if (!(*str == ' ' || *str == '(' || *str == ')' ||
*str == '1' || *str == '2' || *str == 'a' ||
*str == 'x' || *str == 'b'))
return 0;
str++;
}
return 1;
}
basically it checks a string for any characters other then the ones listed and returns false if it finds one. is there a more simple function?