char state;
The above is only a single character, not a string.
if ( state == "AL" || "Al" || "al")
The above is equivalent to the following, which is not what you want.
if ( state == ("AL" || "Al" || "al"))
Besides, to compare C-style strings, you usestrcmp.
If state were a std::string, then you might do this.
if ( state == "AL" || state == "Al" || state == "al" )
As a rule of thumb while you are new, if you think you need a cast to "fix" something, you are wrong. When you can explain what a cast actually is to others, then you may be more ready to use them.
Dave Sinkula
long time no c
5,058 posts since Apr 2004
Reputation Points: 2,780
Solved Threads: 314