I am writing a script where I need to make sure they only put in certain characters. These include "x", "/", "+", "-", "%" (basic math operators), every letter from a -z and every number. I have the following below that only checks for alpha and number. How can I check that only certain one are used, and everything else, such as "&" or ">", are correctly error handled?
//check to see if user has input an incorrect symbol or letter
if (isalpha(symbol) || isalnum(symbol))
{
printf("You must enter a math operator, not a letter or number. \n \n");
}
else {//move along nothing to see here
}