My IF is preventing me from correctly validating an array of chars properly. Each char has it's own class as shown below. I am only capable of classying white spaces, numbers, signs and letters.
charType dot is used for decimal places, but for some reason, the statement interprets that it's a sign (+/-)
charType Ee is for exponents, but I can't seem to isolate it. It's treated as a letter even if the item to it's left (known as char c) is a digit.
Here is the statement:
charType getCharType(char a,char c) //getCharType is an process that identifies the characters accordingly
{ charType b;
if(isspace(a))
b = white;
else if(isalpha(a)) //identify all letters
b = letter;
else if(isdigit(a)) //identify all digits
b = digit;
else if(a='-')
b = sign;
else if(a='+')
b = sign;
else if(a='.') //identify the dot
b = dot;
else if((a='E')&&(isdigit(c))) //identify exponents
b = Ee;
else if((a='e')&&(isdigit(c))) //identify exponents
b = Ee;
return b;
}
Previously resolved IF question:
Hello again, It's been a while since I've tried this, but I need to validate whether a char is between a and z. this is what I wrote, perhaps someone can help me out: